svn commit: r252335 - head/sys/amd64/vmm
Author: grehan Date: Fri Jun 28 06:05:33 2013 New Revision: 252335 URL: http://svnweb.freebsd.org/changeset/base/252335 Log: Make sure all CPUID values are handled, instead of exiting the bhyve process when an unhandled one is encountered. Hide some additional capabilities from the guest (e.g. debug store). This fixes the issue with FreeBSD 9.1 MP guests exiting the VM on AP spinup (where CPUID is used when sync'ing the TSCs) and the issue with the Java build where CPUIDs are issued from a guest userspace. Submitted by: tycho nightingale at pluribusnetworks com Reviewed by: neel Reported by: many Modified: head/sys/amd64/vmm/x86.c Modified: head/sys/amd64/vmm/x86.c == --- head/sys/amd64/vmm/x86.cFri Jun 28 05:21:59 2013(r252334) +++ head/sys/amd64/vmm/x86.cFri Jun 28 06:05:33 2013(r252335) @@ -45,7 +45,9 @@ __FBSDID($FreeBSD$); #defineCPUID_VM_HIGH 0x4000 -static const char bhyve_id[12] = BHyVE BHyVE ; +static const char bhyve_id[12] = bhyve bhyve ; + +static uint64_t bhyve_xcpuids; int x86_emulate_cpuid(struct vm *vm, int vcpu_id, @@ -77,15 +79,13 @@ x86_emulate_cpuid(struct vm *vm, int vcp * no multi-core or SMT. */ switch (func) { + /* +* Pass these through to the guest +*/ case CPUID__: case CPUID__0002: case CPUID__0003: - case CPUID__000A: - cpuid_count(*eax, *ecx, regs); - break; - case CPUID_8000_: - case CPUID_8000_0001: case CPUID_8000_0002: case CPUID_8000_0003: case CPUID_8000_0004: @@ -94,6 +94,15 @@ x86_emulate_cpuid(struct vm *vm, int vcp cpuid_count(*eax, *ecx, regs); break; + case CPUID_8000_0001: + /* +* Hide rdtscp/ia32_tsc_aux until we know how +* to deal with them. +*/ + cpuid_count(*eax, *ecx, regs); + regs[3] = ~AMDID_RDTSCP; + break; + case CPUID_8000_0007: cpuid_count(*eax, *ecx, regs); /* @@ -150,6 +159,11 @@ x86_emulate_cpuid(struct vm *vm, int vcp */ regs[2] = ~CPUID2_MON; +/* +* Hide the performance and debug features. +*/ + regs[2] = ~CPUID2_PDCM; + /* * Hide thermal monitoring */ @@ -161,6 +175,11 @@ x86_emulate_cpuid(struct vm *vm, int vcp */ regs[3] = ~(CPUID_MCA | CPUID_MCE | CPUID_MTRR); +/* +* Hide the debug store capability. +*/ + regs[3] = ~CPUID_DS; + /* * Disable multi-core. */ @@ -180,6 +199,7 @@ x86_emulate_cpuid(struct vm *vm, int vcp case CPUID__0006: case CPUID__0007: + case CPUID__000A: /* * Handle the access, but report 0 for * all options @@ -203,17 +223,25 @@ x86_emulate_cpuid(struct vm *vm, int vcp case 0x4000: regs[0] = CPUID_VM_HIGH; bcopy(bhyve_id, regs[1], 4); - bcopy(bhyve_id, regs[2], 4); - bcopy(bhyve_id, regs[3], 4); + bcopy(bhyve_id + 4, regs[2], 4); + bcopy(bhyve_id + 8, regs[3], 4); break; + default: - /* XXX: Leaf 5? */ - return (0); + /* +* The leaf value has already been clamped so +* simply pass this through, keeping count of +* how many unhandled leaf values have been seen. +*/ + atomic_add_long(bhyve_xcpuids, 1); + cpuid_count(*eax, *ecx, regs); + break; } *eax = regs[0]; *ebx = regs[1]; *ecx = regs[2]; *edx = regs[3]; + return (1); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r252101 - head/release
On Jun 22, 2013, at 3:51 PM, Glen Barber wrote: On Sat, Jun 22, 2013 at 03:39:41PM -0700, Garrett Cooper wrote: On Jun 22, 2013, at 3:12 PM, Glen Barber wrote: Author: gjb Date: Sat Jun 22 22:12:24 2013 New Revision: 252101 URL: http://svnweb.freebsd.org/changeset/base/252101 Log: If MAKE_CONF and/or SRC_CONF are set and not character devices, copy to chroot to use with release build. Submitted by: Garrett Cooper (original version) Approved by:kib (mentor) MFC after: 1 week Modified: head/release/release.sh Technically copying /dev/null to a file creates a 0 byte file. That's why I used cp in the patch I submitted over email. Thanks! Right. But did you read the script? Both __MAKE_CONF and SRCCONF are set to the path of the local files. Oh, interesting… I see what you did there instead of what I proposed; I copied __MAKE_CONF to /etc/make.conf and SRCCONF to /etc/src.conf for symmetry with the base system, but your method works more than mine did (I forgot that you were passing those vars in the chroot environment). Should the files be installed to /etc/ in the system default locations ? Thanks! -Garrett ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252336 - head/usr.sbin/bhyve
Author: grehan Date: Fri Jun 28 06:25:04 2013 New Revision: 252336 URL: http://svnweb.freebsd.org/changeset/base/252336 Log: Allow 8259 registers to be read. This is a transient condition during Linux boot. Submitted by: tycho nightingale at pluribusnetworks com Reviewed by: neel Modified: head/usr.sbin/bhyve/atpic.c Modified: head/usr.sbin/bhyve/atpic.c == --- head/usr.sbin/bhyve/atpic.c Fri Jun 28 06:05:33 2013(r252335) +++ head/usr.sbin/bhyve/atpic.c Fri Jun 28 06:25:04 2013(r252336) @@ -37,13 +37,6 @@ __FBSDID($FreeBSD$); #include inout.h -/* - * FreeBSD only writes to the 8259 interrupt controllers to put them in a - * shutdown state. - * - * So, we just ignore the writes. - */ - #defineIO_ICU1 0x20 #defineIO_ICU2 0xA0 #defineICU_IMR_OFFSET 1 @@ -55,8 +48,14 @@ atpic_handler(struct vmctx *ctx, int vcp if (bytes != 1) return (-1); - if (in) - return (-1); + if (in) { + if (port ICU_IMR_OFFSET) { + /* all interrupts masked */ + *eax = 0xff; + } else { + *eax = 0x00; + } + } /* Pretend all writes to the 8259 are alright */ return (0); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r252313 - head/sys/kern
On Fri, Jun 28, 2013 at 03:03:46AM +0200, Mateusz Guzik wrote: On Thu, Jun 27, 2013 at 07:14:04PM +, Mikolaj Golub wrote: Author: trociny Date: Thu Jun 27 19:14:03 2013 New Revision: 252313 URL: http://svnweb.freebsd.org/changeset/base/252313 Log: To avoid LOR, always drop the filedesc lock before exporting fd to sbuf. Reviewed by: kib MFC after:3 days Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c == --- head/sys/kern/kern_descrip.cThu Jun 27 18:59:07 2013 (r252312) +++ head/sys/kern/kern_descrip.cThu Jun 27 19:14:03 2013 (r252313) @@ -3427,12 +3427,10 @@ kern_proc_filedesc_out(struct proc *p, * re-validate and re-evaluate its properties when * the loop continues. */ - if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) - FILEDESC_SUNLOCK(fdp); + FILEDESC_SUNLOCK(fdp); error = export_fd_to_sb(data, type, i, fflags, refcnt, offset, fd_cap_rights, kif, sb, remainder); - if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) - FILEDESC_SLOCK(fdp); + FILEDESC_SLOCK(fdp); if (error) break; } Is this really ok? What prevents given fd from going away during export_fd_to_sb execution? Both DTYPE_VNODE and DTYPE_FIFO pass down a vrefed vnode so these are safe. But for example DTYPE_SOCKET goes with fp-f_data, which can go away in the meantime (or I'm misreading the code). I suggest obtainng ref to fp and passing it down in all cases. Oops, I am sorry for missed this. But, I do not actually like the idea of referencing the fd. It de-facto means that the process calling the sysctl duped the descriptor, potentially causing the close to be performed in the sysctl context on dereference. Ideal solution would be to drop the filedesc lock between processing of the filedescriptors and draining sbuf while lock is dropped. pgpZwWP2jtCkR.pgp Description: PGP signature
svn commit: r252337 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Author: gavin Date: Fri Jun 28 07:51:12 2013 New Revision: 252337 URL: http://svnweb.freebsd.org/changeset/base/252337 Log: Don't try to re-insert an already present but invalid page. This could happen if a thread doing a page-in loses a ZFS range lock race to a thread writing to the same range This fixes panic: vm_page_alloc: pindex already allocated in http://docs.FreeBSD.org/cgi/mid.cgi?1372165971.96049.42.camel Submitted by: avg MFC after:1 week Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c == --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Jun 28 06:25:04 2013(r252336) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Fri Jun 28 07:51:12 2013(r252337) @@ -345,10 +345,13 @@ page_busy(vnode_t *vp, int64_t start, in vm_page_sleep(pp, zfsmwb); continue; } - } else { + } else if (pp == NULL) { pp = vm_page_alloc(obj, OFF_TO_IDX(start), VM_ALLOC_SYSTEM | VM_ALLOC_IFCACHED | VM_ALLOC_NOBUSY); + } else { + ASSERT(pp != NULL !pp-valid); + pp = NULL; } if (pp != NULL) { ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r252209 - in head: share/man/man9 sys/kern sys/sys
On Thu, Jun 27, 2013 at 4:34 PM, John Baldwin j...@freebsd.org wrote: On Wednesday, June 26, 2013 3:26:38 am Andre Oppermann wrote: On 25.06.2013 20:44, John Baldwin wrote: Author: jhb Date: Tue Jun 25 18:44:15 2013 New Revision: 252209 URL: http://svnweb.freebsd.org/changeset/base/252209 Log: Several improvements to rmlock(9). Many of these are based on patches provided by Isilon. - Add an rm_assert() supporting various lock assertions similar to other locking primitives. Because rmlocks track readers the assertions are always fully accurate unlike rw_assert() and sx_assert(). - Flesh out the lock class methods for rmlocks to support sleeping via condvars and rm_sleep() (but only while holding write locks), rmlock details in 'show lock' in DDB, and the lc_owner method used by dtrace. - Add an internal destroyed cookie so that API functions can assert that an rmlock is not destroyed. - Make use of rm_assert() to add various assertions to the API (e.g. to assert locks are held when an unlock routine is called). - Give RM_SLEEPABLE locks their own lock class and always use the rmlock's own lock_object with WITNESS. - Use THREAD_NO_SLEEPING() / THREAD_SLEEPING_OK() to disallow sleeping while holding a read lock on an rmlock. Thanks! Would it make sense to move struct rm_queue from struct pcpu itself to using DPCPU as a next step? Perhaps. It might make pcpu.h cleaner, aside from that concern I don't think it really matters much. It cannot for performance reasons. I had a comment ready for this but I'm not sure if it was ever committed. Attilio -- Peace can only be achieved by understanding - A. Einstein ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r252330 - in head/sys: conf geom kern sys vm
Hi, Do we really need another allocator / resource manager just for this? Adrian On 27 June 2013 20:51, Jeff Roberson j...@freebsd.org wrote: Author: jeff Date: Fri Jun 28 03:51:20 2013 New Revision: 252330 URL: http://svnweb.freebsd.org/changeset/base/252330 Log: - Add a general purpose resource allocator, vmem, from NetBSD. It was originally inspired by the Solaris vmem detailed in the proceedings of usenix 2001. The NetBSD version was heavily refactored for bugs and simplicity. - Use this resource allocator to allocate the buffer and transient maps. Buffer cache defrags are reduced by 25% when used by filesystems with mixed block sizes. Ultimately this may permit dynamic buffer cache sizing on low KVA machines. Discussed with: alc, kib, attilio Tested by:pho Sponsored by: EMC / Isilon Storage Division Added: head/sys/kern/subr_vmem.c (contents, props changed) head/sys/sys/vmem.h (contents, props changed) Modified: head/sys/conf/files head/sys/geom/geom_io.c head/sys/kern/vfs_bio.c head/sys/sys/malloc.h head/sys/vm/vm.h head/sys/vm/vm_init.c head/sys/vm/vm_kern.c head/sys/vm/vm_kern.h head/sys/vm/vm_object.c head/sys/vm/vm_pager.c head/sys/vm/vm_pager.h Modified: head/sys/conf/files == --- head/sys/conf/files Fri Jun 28 03:41:23 2013(r252329) +++ head/sys/conf/files Fri Jun 28 03:51:20 2013(r252330) @@ -2797,6 +2797,7 @@ kern/subr_trap.c standard kern/subr_turnstile.c standard kern/subr_uio.cstandard kern/subr_unit.c standard +kern/subr_vmem.c standard kern/subr_witness.coptional witness kern/sys_capability.c standard kern/sys_generic.c standard Modified: head/sys/geom/geom_io.c == --- head/sys/geom/geom_io.c Fri Jun 28 03:41:23 2013(r252329) +++ head/sys/geom/geom_io.c Fri Jun 28 03:51:20 2013(r252330) @@ -49,6 +49,7 @@ __FBSDID($FreeBSD$); #include sys/proc.h #include sys/stack.h #include sys/sysctl.h +#include sys/vmem.h #include sys/errno.h #include geom/geom.h @@ -626,7 +627,6 @@ g_io_transient_map_bio(struct bio *bp) vm_offset_t addr; long size; u_int retried; - int rv; KASSERT(unmapped_buf_allowed, (unmapped disabled)); @@ -636,10 +636,7 @@ g_io_transient_map_bio(struct bio *bp) retried = 0; atomic_add_long(transient_maps, 1); retry: - vm_map_lock(bio_transient_map); - if (vm_map_findspace(bio_transient_map, vm_map_min(bio_transient_map), - size, addr)) { - vm_map_unlock(bio_transient_map); + if (vmem_alloc(transient_arena, size, M_BESTFIT | M_NOWAIT, addr)) { if (transient_map_retries != 0 retried = transient_map_retries) { g_io_deliver(bp, EDEADLK/* XXXKIB */); @@ -651,7 +648,7 @@ retry: /* * Naive attempt to quisce the I/O to get more * in-flight requests completed and defragment -* the bio_transient_map. +* the transient_arena. */ CTR3(KTR_GEOM, g_down retrymap bp %p provider %s r %d, bp, bp-bio_to-name, retried); @@ -661,12 +658,6 @@ retry: goto retry; } } - rv = vm_map_insert(bio_transient_map, NULL, 0, addr, addr + size, - VM_PROT_RW, VM_PROT_RW, MAP_NOFAULT); - KASSERT(rv == KERN_SUCCESS, - (vm_map_insert(bio_transient_map) rv %d %jx %lx, - rv, (uintmax_t)addr, size)); - vm_map_unlock(bio_transient_map); atomic_add_int(inflight_transient_maps, 1); pmap_qenter((vm_offset_t)addr, bp-bio_ma, OFF_TO_IDX(size)); bp-bio_data = (caddr_t)addr + bp-bio_ma_offset; Added: head/sys/kern/subr_vmem.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sys/kern/subr_vmem.c Fri Jun 28 03:51:20 2013(r252330) @@ -0,0 +1,1372 @@ +/*- + * Copyright (c)2006,2007,2008,2009 YAMAMOTO Takashi, + * Copyright (c) 2013 EMC 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 + *
Re: svn commit: r252313 - head/sys/kern
On Fri, Jun 28, 2013 at 09:44:30AM +0300, Konstantin Belousov wrote: On Fri, Jun 28, 2013 at 03:03:46AM +0200, Mateusz Guzik wrote: On Thu, Jun 27, 2013 at 07:14:04PM +, Mikolaj Golub wrote: Author: trociny Date: Thu Jun 27 19:14:03 2013 New Revision: 252313 URL: http://svnweb.freebsd.org/changeset/base/252313 Log: To avoid LOR, always drop the filedesc lock before exporting fd to sbuf. Reviewed by:kib MFC after: 3 days Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c == --- head/sys/kern/kern_descrip.c Thu Jun 27 18:59:07 2013 (r252312) +++ head/sys/kern/kern_descrip.c Thu Jun 27 19:14:03 2013 (r252313) @@ -3427,12 +3427,10 @@ kern_proc_filedesc_out(struct proc *p, * re-validate and re-evaluate its properties when * the loop continues. */ - if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) - FILEDESC_SUNLOCK(fdp); + FILEDESC_SUNLOCK(fdp); error = export_fd_to_sb(data, type, i, fflags, refcnt, offset, fd_cap_rights, kif, sb, remainder); - if (type == KF_TYPE_VNODE || type == KF_TYPE_FIFO) - FILEDESC_SLOCK(fdp); + FILEDESC_SLOCK(fdp); if (error) break; } Is this really ok? What prevents given fd from going away during export_fd_to_sb execution? Both DTYPE_VNODE and DTYPE_FIFO pass down a vrefed vnode so these are safe. But for example DTYPE_SOCKET goes with fp-f_data, which can go away in the meantime (or I'm misreading the code). Thanks! I suggest obtainng ref to fp and passing it down in all cases. Oops, I am sorry for missed this. But, I do not actually like the idea of referencing the fd. It de-facto means that the process calling the sysctl duped the descriptor, potentially causing the close to be performed in the sysctl context on dereference. Ideal solution would be to drop the filedesc lock between processing of the filedescriptors and draining sbuf while lock is dropped. You mean something like below? (not well tested yet) -- Mikolaj Golub Index: sys/kern/kern_descrip.c === --- sys/kern/kern_descrip.c (revision 252313) +++ sys/kern/kern_descrip.c (working copy) @@ -3176,10 +3176,16 @@ CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); #endif +struct export_fd_buf { + struct filedesc *fdp; + struct sbuf *sb; + ssize_t remainder; + struct kinfo_file kif; +}; + static int export_fd_to_sb(void *data, int type, int fd, int fflags, int refcnt, -int64_t offset, cap_rights_t fd_cap_rights, struct kinfo_file *kif, -struct sbuf *sb, ssize_t *remainder) +int64_t offset, cap_rights_t fd_cap_rights, struct export_fd_buf *efbuf) { struct { int fflag; @@ -3202,16 +3208,20 @@ { O_TRUNC, KF_FLAG_TRUNC } }; #define NFFLAGS (sizeof(fflags_table) / sizeof(*fflags_table)) + struct kinfo_file *kif; struct vnode *vp; int error; unsigned int i; - if (*remainder == 0) + if (efbuf-remainder == 0) return (0); + kif = efbuf-kif; bzero(kif, sizeof(*kif)); switch (type) { case KF_TYPE_FIFO: case KF_TYPE_VNODE: + if (efbuf-fdp != NULL) + FILEDESC_SUNLOCK(efbuf-fdp); vp = (struct vnode *)data; error = fill_vnode_info(vp, kif); vrele(vp); @@ -3255,15 +3265,19 @@ kif-kf_structsize = offsetof(struct kinfo_file, kf_path) + strlen(kif-kf_path) + 1; kif-kf_structsize = roundup(kif-kf_structsize, sizeof(uint64_t)); - if (*remainder != -1) { - if (*remainder kif-kf_structsize) { + if (efbuf-remainder != -1) { + if (efbuf-remainder kif-kf_structsize) { /* Terminate export. */ - *remainder = 0; + efbuf-remainder = 0; return (0); } - *remainder -= kif-kf_structsize; + efbuf-remainder -= kif-kf_structsize; } - error = sbuf_bcat(sb, kif, kif-kf_structsize); + if (efbuf-fdp != NULL type != KF_TYPE_FIFO type != KF_TYPE_VNODE) + FILEDESC_SUNLOCK(efbuf-fdp); + error = sbuf_bcat(efbuf-sb, kif, kif-kf_structsize); + if (efbuf-fdp != NULL) + FILEDESC_SLOCK(efbuf-fdp); return (error); } @@ -3277,18 +3291,16 @@ { struct file *fp; struct filedesc *fdp; - struct kinfo_file *kif; + struct export_fd_buf *efbuf; struct vnode *cttyvp, *textvp, *tracevp; int64_t offset; void *data; - ssize_t remainder; int error, i; int type, refcnt, fflags; cap_rights_t fd_cap_rights; PROC_LOCK_ASSERT(p, MA_OWNED); - remainder = maxlen; /* ktrace vnode */ tracevp = p-p_tracevp; if (tracevp != NULL) @@ -3306,46 +3318,44 @@ } fdp = fdhold(p); PROC_UNLOCK(p); - kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK); + efbuf = malloc(sizeof(*efbuf), M_TEMP, M_WAITOK); + efbuf-fdp = NULL; + efbuf-sb = sb; + efbuf-remainder = maxlen; if
svn commit: r252338 - head/crypto/openssh
Author: des Date: Fri Jun 28 09:41:59 2013 New Revision: 252338 URL: http://svnweb.freebsd.org/changeset/base/252338 Log: r251088 reverted the default value for UsePrivilegeSeparation from sandbox to yes, but did not update the documentation to match. Modified: head/crypto/openssh/sshd_config head/crypto/openssh/sshd_config.5 Modified: head/crypto/openssh/sshd_config == --- head/crypto/openssh/sshd_config Fri Jun 28 07:51:12 2013 (r252337) +++ head/crypto/openssh/sshd_config Fri Jun 28 09:41:59 2013 (r252338) @@ -105,7 +105,7 @@ #PrintLastLog yes #TCPKeepAlive yes #UseLogin no -#UsePrivilegeSeparation sandbox +#UsePrivilegeSeparation yes #PermitUserEnvironment no #Compression delayed #ClientAliveInterval 0 Modified: head/crypto/openssh/sshd_config.5 == --- head/crypto/openssh/sshd_config.5 Fri Jun 28 07:51:12 2013 (r252337) +++ head/crypto/openssh/sshd_config.5 Fri Jun 28 09:41:59 2013 (r252338) @@ -1169,7 +1169,7 @@ the privilege of the authenticated user. The goal of privilege separation is to prevent privilege escalation by containing any corruption within the unprivileged processes. The default is -.Dq sandbox . +.Dq yes . If .Cm UsePrivilegeSeparation is set to ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r251886 - in head: contrib/apr contrib/apr-util contrib/serf contrib/sqlite3 contrib/subversion share/mk usr.bin usr.bin/svn usr.bin/svn/lib usr.bin/svn/lib/libapr usr.bin/svn/lib/liba
Peter Wemm pe...@freebsd.org writes: Author: peter Date: Tue Jun 18 02:53:45 2013 New Revision: 251886 URL: http://svnweb.freebsd.org/changeset/base/251886 Log: Introduce svnlite so that we can check out our source code again. Can you teach apr about WITH_ICONV? $ svnsync sync file:///freebsd/base svnsync: E22: Safe data 'In the Xen block front driver, take advantage of backends that support cache flush and write barrier commands. ... Submitted by: Roger Pau Monn' was followed by non-ASCII byte 195: unable to convert to/from UTF-8 Exit 1 $ svn info file:///freebsd/base | awk '/^Rev/ { print $2 }' 252259 $ locale | awk -F. '/ctype/I { print $2; exit }' UTF-8 Not sure why svnsync tries to convert from UTF-8 to UTF-8 only to fail without iconv(). Index: usr.bin/svn/lib/libapr_util/Makefile === --- usr.bin/svn/lib/libapr_util/Makefile(revision 252337) +++ usr.bin/svn/lib/libapr_util/Makefile(working copy) @@ -1,6 +1,7 @@ # $FreeBSD$ .include ${.CURDIR}/../Makefile.inc +.include bsd.own.mk INTERNALLIB= yes LIB= apr-util @@ -28,5 +29,11 @@ CFLAGS+= -DHAVE_CONFIG_H \ -I${APR}/include/arch/unix \ -I${APR}/include +.if ${MK_ICONV} != no +CFLAGS+= -DHAVE_ICONV_H -DAPU_HAVE_ICONV=1 +.else +CFLAGS+= -DAPU_HAVE_ICONV=0 +.endif + .include bsd.lib.mk Index: usr.bin/svn/lib/libapr_util/apu.h === --- usr.bin/svn/lib/libapr_util/apu.h (revision 252337) +++ usr.bin/svn/lib/libapr_util/apu.h (working copy) @@ -85,7 +85,6 @@ #define APU_HAVE_SQLITE2 0 #define APU_HAVE_APR_ICONV 0 -#define APU_HAVE_ICONV 0 #define APR_HAS_XLATE (APU_HAVE_APR_ICONV || APU_HAVE_ICONV) #endif /* APU_H */ Index: usr.bin/svn/lib/libapr_util/apu_config.h === --- usr.bin/svn/lib/libapr_util/apu_config.h(revision 252337) +++ usr.bin/svn/lib/libapr_util/apu_config.h(working copy) @@ -24,9 +24,6 @@ /* Define if expat.h is available */ #define HAVE_EXPAT_H 1 -/* Define to 1 if you have the iconv.h header file. */ -/* #undef HAVE_ICONV_H */ - /* Define to 1 if you have the inttypes.h header file. */ #define HAVE_INTTYPES_H 1 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r252330 - in head/sys: conf geom kern sys vm
On Fri, 28 Jun 2013, Adrian Chadd wrote: Hi, Do we really need another allocator / resource manager just for this? No, however; I have a follow-up patch to replace kmem with this. And then we will use it for NUMA allocations in the kernel. After that it is likely that we could replace several other less efficient allocators with this. Solaris uses it for pids, tids, device unit numbers. etc. We could easily do the same. The existing allocators have failure modes, big O cost, and allocation requirements that are not tolerable for use in the vm. This also has a very nice feature that works with UMA to provide per-cpu caches of arbitrary number ranges. So it is more scalable as well as providing for less fragmentation. Thanks, Jeff Adrian On 27 June 2013 20:51, Jeff Roberson j...@freebsd.org wrote: Author: jeff Date: Fri Jun 28 03:51:20 2013 New Revision: 252330 URL: http://svnweb.freebsd.org/changeset/base/252330 Log: - Add a general purpose resource allocator, vmem, from NetBSD. It was originally inspired by the Solaris vmem detailed in the proceedings of usenix 2001. The NetBSD version was heavily refactored for bugs and simplicity. - Use this resource allocator to allocate the buffer and transient maps. Buffer cache defrags are reduced by 25% when used by filesystems with mixed block sizes. Ultimately this may permit dynamic buffer cache sizing on low KVA machines. Discussed with: alc, kib, attilio Tested by:pho Sponsored by: EMC / Isilon Storage Division Added: head/sys/kern/subr_vmem.c (contents, props changed) head/sys/sys/vmem.h (contents, props changed) Modified: head/sys/conf/files head/sys/geom/geom_io.c head/sys/kern/vfs_bio.c head/sys/sys/malloc.h head/sys/vm/vm.h head/sys/vm/vm_init.c head/sys/vm/vm_kern.c head/sys/vm/vm_kern.h head/sys/vm/vm_object.c head/sys/vm/vm_pager.c head/sys/vm/vm_pager.h Modified: head/sys/conf/files == --- head/sys/conf/files Fri Jun 28 03:41:23 2013(r252329) +++ head/sys/conf/files Fri Jun 28 03:51:20 2013(r252330) @@ -2797,6 +2797,7 @@ kern/subr_trap.c standard kern/subr_turnstile.c standard kern/subr_uio.cstandard kern/subr_unit.c standard +kern/subr_vmem.c standard kern/subr_witness.coptional witness kern/sys_capability.c standard kern/sys_generic.c standard Modified: head/sys/geom/geom_io.c == --- head/sys/geom/geom_io.c Fri Jun 28 03:41:23 2013(r252329) +++ head/sys/geom/geom_io.c Fri Jun 28 03:51:20 2013(r252330) @@ -49,6 +49,7 @@ __FBSDID($FreeBSD$); #include sys/proc.h #include sys/stack.h #include sys/sysctl.h +#include sys/vmem.h #include sys/errno.h #include geom/geom.h @@ -626,7 +627,6 @@ g_io_transient_map_bio(struct bio *bp) vm_offset_t addr; long size; u_int retried; - int rv; KASSERT(unmapped_buf_allowed, (unmapped disabled)); @@ -636,10 +636,7 @@ g_io_transient_map_bio(struct bio *bp) retried = 0; atomic_add_long(transient_maps, 1); retry: - vm_map_lock(bio_transient_map); - if (vm_map_findspace(bio_transient_map, vm_map_min(bio_transient_map), - size, addr)) { - vm_map_unlock(bio_transient_map); + if (vmem_alloc(transient_arena, size, M_BESTFIT | M_NOWAIT, addr)) { if (transient_map_retries != 0 retried = transient_map_retries) { g_io_deliver(bp, EDEADLK/* XXXKIB */); @@ -651,7 +648,7 @@ retry: /* * Naive attempt to quisce the I/O to get more * in-flight requests completed and defragment -* the bio_transient_map. +* the transient_arena. */ CTR3(KTR_GEOM, g_down retrymap bp %p provider %s r %d, bp, bp-bio_to-name, retried); @@ -661,12 +658,6 @@ retry: goto retry; } } - rv = vm_map_insert(bio_transient_map, NULL, 0, addr, addr + size, - VM_PROT_RW, VM_PROT_RW, MAP_NOFAULT); - KASSERT(rv == KERN_SUCCESS, - (vm_map_insert(bio_transient_map) rv %d %jx %lx, - rv, (uintmax_t)addr, size)); - vm_map_unlock(bio_transient_map); atomic_add_int(inflight_transient_maps, 1); pmap_qenter((vm_offset_t)addr, bp-bio_ma, OFF_TO_IDX(size)); bp-bio_data = (caddr_t)addr + bp-bio_ma_offset; Added: head/sys/kern/subr_vmem.c == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++
svn commit: r252341 - head/sys/dev/re
Author: pluknet Date: Fri Jun 28 14:41:06 2013 New Revision: 252341 URL: http://svnweb.freebsd.org/changeset/base/252341 Log: Correct comment typos. Modified: head/sys/dev/re/if_re.c Modified: head/sys/dev/re/if_re.c == --- head/sys/dev/re/if_re.c Fri Jun 28 10:21:49 2013(r252340) +++ head/sys/dev/re/if_re.c Fri Jun 28 14:41:06 2013(r252341) @@ -1321,7 +1321,7 @@ re_attach(device_t dev) SYS_RES_IRQ, rid, RF_ACTIVE); if (sc-rl_irq[i] == NULL) { device_printf(dev, - couldn't llocate IRQ resources for + couldn't allocate IRQ resources for message %d\n, rid); error = ENXIO; goto fail; @@ -1632,7 +1632,7 @@ re_attach(device_t dev) /* * Don't enable TSO by default. It is known to generate * corrupted TCP segments(bad TCP options) under certain -* circumtances. +* circumstances. */ ifp-if_hwassist = ~CSUM_TSO; ifp-if_capenable = ~(IFCAP_TSO4 | IFCAP_VLAN_HWTSO); @@ -2784,7 +2784,7 @@ re_encap(struct rl_softc *sc, struct mbu /* * Unconditionally enable IP checksum if TCP or UDP * checksum is required. Otherwise, TCP/UDP checksum -* does't make effects. +* doesn't make effects. */ if (((*m_head)-m_pkthdr.csum_flags RE_CSUM_FEATURES) != 0) { if ((sc-rl_flags RL_FLAG_DESCV2) == 0) { @@ -3247,7 +3247,7 @@ re_init_locked(struct rl_softc *sc) if ((sc-rl_flags RL_FLAG_JUMBOV2) != 0) { /* * For controllers that use new jumbo frame scheme, -* set maximum size of jumbo frame depedning on +* set maximum size of jumbo frame depending on * controller revisions. */ if (ifp-if_mtu RL_MTU) @@ -3948,7 +3948,7 @@ re_sysctl_stats(SYSCTL_HANDLER_ARGS) RL_UNLOCK(sc); if (i == 0) { device_printf(sc-rl_dev, - DUMP statistics request timedout\n); + DUMP statistics request timed out\n); return (ETIMEDOUT); } done: ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r252101 - head/release
On Thu, Jun 27, 2013 at 12:13:51PM -0700, Garrett Cooper wrote: On Jun 22, 2013, at 3:51 PM, Glen Barber wrote: On Sat, Jun 22, 2013 at 03:39:41PM -0700, Garrett Cooper wrote: On Jun 22, 2013, at 3:12 PM, Glen Barber wrote: Author: gjb Date: Sat Jun 22 22:12:24 2013 New Revision: 252101 URL: http://svnweb.freebsd.org/changeset/base/252101 Log: If MAKE_CONF and/or SRC_CONF are set and not character devices, copy to chroot to use with release build. Submitted by: Garrett Cooper (original version) Approved by: kib (mentor) MFC after:1 week Modified: head/release/release.sh Technically copying /dev/null to a file creates a 0 byte file. That's why I used cp in the patch I submitted over email. Thanks! Right. But did you read the script? Both __MAKE_CONF and SRCCONF are set to the path of the local files. Oh, interesting… I see what you did there instead of what I proposed; I copied __MAKE_CONF to /etc/make.conf and SRCCONF to /etc/src.conf for symmetry with the base system, but your method works more than mine did (I forgot that you were passing those vars in the chroot environment). Should the files be installed to /etc/ in the system default locations ? My initial reaction is no. Those who are using __MAKE_CONF and SRCCONF in such an environment know why they are doing so. So, in my opinion, it is up to them to modify the end-release as needed. Since __MAKE_CONF and SRCCONF are pointing to /dev/null in release builds, I do not see this as necessary. Moreso, I do not want to introduce a level of confusion where /etc/make.conf and/or /etc/src.conf are modified within the release, or worse, in an altogether different location. There is too much complexity here. Glen pgpwry168PK1B.pgp Description: PGP signature
Re: svn commit: r252330 - in head/sys: conf geom kern sys vm
On 28 June 2013 03:36, Jeff Roberson jrober...@jroberson.net wrote: Do we really need another allocator / resource manager just for this? No, however; I have a follow-up patch to replace kmem with this. And then we will use it for NUMA allocations in the kernel. After that it is likely that we could replace several other less efficient allocators with this. Solaris uses it for pids, tids, device unit numbers. etc. We could easily do the same. The existing allocators have failure modes, big O cost, and allocation requirements that are not tolerable for use in the vm. This also has a very nice feature that works with UMA to provide per-cpu caches of arbitrary number ranges. So it is more scalable as well as providing for less fragmentation. Sweet. :) Thanks, -adrian ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252342 - head/sys/kern
Author: rstone Date: Fri Jun 28 15:55:30 2013 New Revision: 252342 URL: http://svnweb.freebsd.org/changeset/base/252342 Log: Correct a bug that prevented deadlkres from (almost) ever firing. deadlkres was using a reversed test to check whether ticks had rolled over. This meant that deadlkres could only fire after ticks had rolled over. This test was actually unnecessary as deadlkres only ever took the difference of ticks values which is safe even in the presence of ticks rollover. Remove the tests entirely. Now deadlkres will properly fire after a lock has been held after the timeout period. MFC after:1 month Modified: head/sys/kern/kern_clock.c Modified: head/sys/kern/kern_clock.c == --- head/sys/kern/kern_clock.c Fri Jun 28 14:41:06 2013(r252341) +++ head/sys/kern/kern_clock.c Fri Jun 28 15:55:30 2013(r252342) @@ -216,13 +216,8 @@ deadlkres(void) } FOREACH_THREAD_IN_PROC(p, td) { - /* -* Once a thread is found in interesting -* state a possible ticks wrap-up needs to be -* checked. -*/ thread_lock(td); - if (TD_ON_LOCK(td) ticks td-td_blktick) { + if (TD_ON_LOCK(td)) { /* * The thread should be blocked on a @@ -247,8 +242,7 @@ deadlkres(void) __func__, td, tticks); } } else if (TD_IS_SLEEPING(td) - TD_ON_SLEEPQ(td) - ticks td-td_blktick) { + TD_ON_SLEEPQ(td)) { /* * Check if the thread is sleeping on a ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252346 - head/share/man/man9
Author: jhb Date: Fri Jun 28 16:33:45 2013 New Revision: 252346 URL: http://svnweb.freebsd.org/changeset/base/252346 Log: Make a pass over this page to correct and clarify a few things as well as some general word-smithing. - Don't claim that adaptive mutexes have a timeout (they don't). - Don't treat pool mutexes as a separate primitive in a few places. - Describe sleepable read-mostly locks as a separate lock type and add them to the various tables. - Don't claim that sx locks are less efficient. That hasn't been true in a few years now. - Describe lockmanager locks next to sx locks since they are very similar in terms of rules, etc., and so that all the lock primitives are grouped together before the non-lock primitives. - Similarly, move the section on Giant after the description of all the non-lock primitives to preserve grouping. - Condition variables work on several types of locks, not just mutexes. - Add a bit of language to compare/contrast condition variables with sleep/wakeup. - Add a note about why pause(9) is unique. - Add some language to define bounded vs unbounded sleeps and explain why they are treated separately (bounded sleeps only need CPU time to make forward progress). - Don't state that using mtx_sleep() is a bad idea. It is in fact rather necessary. - Rework the interaction table a bit. First, it did not include really include sleepable rmlocks and it left out lockmgr entirely. To get things to fit, combine similar lock types into the same column / row, and explicitly state what sleep means. The notes about recursion and lock order were also a bit banal (lock order is always important, not just in the few places annotated here), so remove them. In particular, the lock order note would need to be on just about every cell. If we want to document recursion I think a better approach would be a separate table summarizing the recursion rules for each lock as having too many notes clutters the table. - Tweak the tables to use less indentation so everything still fits with the added columns. - Correct a few cells in the context mode table. - Use mdoc markup instead of explicit markup in a few places. Requested by: julian MFC after:2 weeks Modified: head/share/man/man9/locking.9 Modified: head/share/man/man9/locking.9 == --- head/share/man/man9/locking.9 Fri Jun 28 16:24:14 2013 (r252345) +++ head/share/man/man9/locking.9 Fri Jun 28 16:33:45 2013 (r252346) @@ -33,53 +33,52 @@ .Sh DESCRIPTION The .Em FreeBSD -kernel is written to run across multiple CPUs and as such requires -several different synchronization primitives to allow the developers -to safely access and manipulate the many data types required. +kernel is written to run across multiple CPUs and as such provides +several different synchronization primitives to allow developers +to safely access and manipulate many data types. .Ss Mutexes -Mutexes (also erroneously called sleep mutexes) are the most commonly used +Mutexes (also called blocking mutexes) are the most commonly used synchronization primitive in the kernel. A thread acquires (locks) a mutex before accessing data shared with other threads (including interrupt threads), and releases (unlocks) it afterwards. If the mutex cannot be acquired, the thread requesting it will wait. -Mutexes are by default adaptive, meaning that +Mutexes are adaptive by default, meaning that if the owner of a contended mutex is currently running on another CPU, -then a thread attempting to acquire the mutex will briefly spin -in the hope that the owner is only briefly holding it, -and might release it shortly. -If the owner does not do so, the waiting thread proceeds to yield the processor, -allowing other threads to run. -If the owner is not currently actually running then the spin step is skipped. +then a thread attempting to acquire the mutex will spin rather than yielding +the processor. Mutexes fully support priority propagation. .Pp See .Xr mutex 9 for details. -.Ss Spin mutexes -Spin mutexes are variation of basic mutexes; the main difference between -the two is that spin mutexes never yield the processor - instead, they spin, -waiting for the thread holding the lock, -(which must be running on another CPU), to release it. -Spin mutexes disable interrupts while the held so as to not get pre-empted. -Since disabling interrupts is expensive, they are also generally slower. -Spin mutexes should be used only when necessary, e.g. to protect data shared +.Ss Spin Mutexes +Spin mutexes are a variation of basic mutexes; the main difference between +the two is that spin mutexes never block. +Instead, they spin while waiting for the lock to be released. +Note that a thread that holds a spin mutex must never yield its CPU to +avoid deadlock. +Unlike
Re: svn commit: r252346 - head/share/man/man9
On Fri, Jun 28, 2013 at 12:33 PM, John Baldwin j...@freebsd.org wrote: Author: jhb Date: Fri Jun 28 16:33:45 2013 New Revision: 252346 URL: http://svnweb.freebsd.org/changeset/base/252346 Log: Make a pass over this page to correct and clarify a few things as well as some general word-smithing. Many thanks for this! A few nits... Modified: head/share/man/man9/locking.9 == --- head/share/man/man9/locking.9 Fri Jun 28 16:24:14 2013 (r252345) +++ head/share/man/man9/locking.9 Fri Jun 28 16:33:45 2013 (r252346) -.Ss Spin mutexes -Spin mutexes are variation of basic mutexes; the main difference between -the two is that spin mutexes never yield the processor - instead, they spin, -waiting for the thread holding the lock, -(which must be running on another CPU), to release it. -Spin mutexes disable interrupts while the held so as to not get pre-empted. -Since disabling interrupts is expensive, they are also generally slower. -Spin mutexes should be used only when necessary, e.g. to protect data shared +.Ss Spin Mutexes +Spin mutexes are a variation of basic mutexes; the main difference between +the two is that spin mutexes never block. +Instead, they spin while waiting for the lock to be released. +Note that a thread that holds a spin mutex must never yield its CPU to +avoid deadlock. I think this needs a comma after CPU (or reordering to emphasize the deadlock avoidance part). +Unlike ordinary mutexes, spin mutexes disable interrupts when acquired. +Since disabling interrupts can be expensive, they are generally slower to +acquire and release. +Spin mutexes should be used only when absolutely necessary, +e.g. to protect data shared with interrupt filter code (see .Xr bus_setup_intr 9 -for details). -.Ss Pool mutexes -With most synchronization primitives, such as mutexes, programmer must -provide a piece of allocated memory to hold the primitive. +for details), +or for scheduler internals. [...] @@ -122,21 +111,41 @@ data structure. +.Ss Lockmanager locks +Lockmanager locks are sleepable shared/exclusive locks used mostly in +.Xr VFS 9 +.Po +as a +.Xr vnode 9 +lock +.Pc +and in the buffer cache +.Po +.Xr BUF_LOCK 9 +.Pc . +They have features other lock types do not have such as sleep +timeouts, blocking upgrades, +writer starvation avoidance, draining, and an interlock mutex, +but this makes them complicated to both use and implement; I think complicated both to use and to implement flows better; in the present text, both is something of an interruption. +for this reason, they should be avoided. +.Pp +See +.Xr lock 9 +for details. @@ -194,7 +181,12 @@ The functions .Fn wakeup , and .Fn wakeup_one -handle event-based thread blocking. +also handle event-based thread blocking. +Unlike condition variables, +arbitrary addresses may be used as wait channels and an dedicated s/an /a / +structure does not need to be allocated. +However, care must be taken to ensure that wait channel addresses are +unique to an event. If a thread must wait for an external event, it is put to sleep by .Fn tsleep , .Fn msleep , @@ -232,122 +225,168 @@ includes the .Sh INTERACTIONS -The primitives interact and have a number of rules regarding how +The primitives can interact and have a number of rules regarding how they can and can not be combined. -Many of these rules are checked using the -.Xr witness 4 -code. -.Ss Bounded vs. unbounded sleep -The following primitives perform bounded sleep: - mutexes, pool mutexes, reader/writer locks and read-mostly locks. -.Pp -The following primitives may perform an unbounded sleep: -shared/exclusive locks, counting semaphores, condition variables, sleep/wakeup and lockmanager locks. -.Pp +Many of these rules are checked by +.Xr witness 4 . +.Ss Bounded vs. Unbounded Sleep +A bounded sleep +.Pq or blocking The Pq should probably go before sleep? +is a sleep where the only resource needed to resume execution of a thread +is CPU time for the owner of a lock that the thread is waiting to acquire. +An unbounded sleep +.Po +often referred to as simply +.Dq sleeping +.Pc +is a sleep where a thread is waiting for an external event or for a condition +to become true. +In particular, +since there is always CPU time available, +a dependency chain of threads in bounded sleeps should always make forward +progress. This sentence is a little bit misleading, as the key fact that the threads in question are in bounded sleeps is buried in the last clause. On first reading, one might think that we are still talking about unbounded sleeps, so having CPU time always available is quite the non sequitur. I would reorder things so that since there is always CPU time available is last. +This requires that no thread in a bounded sleep is waiting for a lock held +by a thread in an
Re: svn commit: r252346 - head/share/man/man9
On Friday, June 28, 2013 1:08:36 pm Benjamin Kaduk wrote: +.Ss Spin Mutexes +Spin mutexes are a variation of basic mutexes; the main difference between +the two is that spin mutexes never block. +Instead, they spin while waiting for the lock to be released. +Note that a thread that holds a spin mutex must never yield its CPU to +avoid deadlock. I think this needs a comma after CPU (or reordering to emphasize the deadlock avoidance part). Hmm, perhaps: To avoid deadlock, a thread that holds a spin mutex must never yield its CPU. ? I think complicated both to use and to implement flows better; in the present text, both is something of an interruption. Yes, both to does flow better. +Unlike condition variables, +arbitrary addresses may be used as wait channels and an dedicated s/an /a / Agreed. +.Ss Bounded vs. Unbounded Sleep +A bounded sleep +.Pq or blocking The Pq should probably go before sleep? I think not. The root sentence is A bounded sleep is a sleep where... If you move the parent you get: A bounded is a sleep where... However, the sleep is a sleep bit is awkward. Perhaps: In a bounded sleep (or blocking), the only resource needed... and then In an unbounded sleep (often referred to as simply sleeping), a thread waits for an external event... +is a sleep where the only resource needed to resume execution of a thread +is CPU time for the owner of a lock that the thread is waiting to acquire. +An unbounded sleep +.Po +often referred to as simply +.Dq sleeping +.Pc +is a sleep where a thread is waiting for an external event or for a condition +to become true. +In particular, +since there is always CPU time available, +a dependency chain of threads in bounded sleeps should always make forward +progress. This sentence is a little bit misleading, as the key fact that the threads in question are in bounded sleeps is buried in the last clause. On first reading, one might think that we are still talking about unbounded sleeps, so having CPU time always available is quite the non sequitur. I would reorder things so that since there is always CPU time available is last. Agreed. Let me know if I should just send a patch off to my mentor for approval. I can review it. -- John Baldwin ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252349 - head/sys/kern
Author: trociny Date: Fri Jun 28 18:07:41 2013 New Revision: 252349 URL: http://svnweb.freebsd.org/changeset/base/252349 Log: Rework r252313: The filedesc lock may not be dropped unconditionally before exporting fd to sbuf: fd might go away during execution. While it is ok for DTYPE_VNODE and DTYPE_FIFO because the export is from a vrefed vnode here, for other types it is unsafe. Instead, drop the lock in export_fd_to_sb(), after preparing data in memory and before writing to sbuf. Spotted by: mjg Suggested by: kib Review by:kib MFC after:1 week Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c == --- head/sys/kern/kern_descrip.cFri Jun 28 17:18:28 2013 (r252348) +++ head/sys/kern/kern_descrip.cFri Jun 28 18:07:41 2013 (r252349) @@ -3176,10 +3176,16 @@ static SYSCTL_NODE(_kern_proc, KERN_PROC CTASSERT(sizeof(struct kinfo_file) == KINFO_FILE_SIZE); #endif +struct export_fd_buf { + struct filedesc *fdp; + struct sbuf *sb; + ssize_t remainder; + struct kinfo_file kif; +}; + static int export_fd_to_sb(void *data, int type, int fd, int fflags, int refcnt, -int64_t offset, cap_rights_t fd_cap_rights, struct kinfo_file *kif, -struct sbuf *sb, ssize_t *remainder) +int64_t offset, cap_rights_t fd_cap_rights, struct export_fd_buf *efbuf) { struct { int fflag; @@ -3202,16 +3208,23 @@ export_fd_to_sb(void *data, int type, in { O_TRUNC, KF_FLAG_TRUNC } }; #defineNFFLAGS (sizeof(fflags_table) / sizeof(*fflags_table)) + struct kinfo_file *kif; struct vnode *vp; - int error; + int error, locked; unsigned int i; - if (*remainder == 0) + if (efbuf-remainder == 0) return (0); + kif = efbuf-kif; bzero(kif, sizeof(*kif)); + locked = efbuf-fdp != NULL; switch (type) { case KF_TYPE_FIFO: case KF_TYPE_VNODE: + if (locked) { + FILEDESC_SUNLOCK(efbuf-fdp); + locked = 0; + } vp = (struct vnode *)data; error = fill_vnode_info(vp, kif); vrele(vp); @@ -3255,15 +3268,19 @@ export_fd_to_sb(void *data, int type, in kif-kf_structsize = offsetof(struct kinfo_file, kf_path) + strlen(kif-kf_path) + 1; kif-kf_structsize = roundup(kif-kf_structsize, sizeof(uint64_t)); - if (*remainder != -1) { - if (*remainder kif-kf_structsize) { + if (efbuf-remainder != -1) { + if (efbuf-remainder kif-kf_structsize) { /* Terminate export. */ - *remainder = 0; + efbuf-remainder = 0; return (0); } - *remainder -= kif-kf_structsize; + efbuf-remainder -= kif-kf_structsize; } - error = sbuf_bcat(sb, kif, kif-kf_structsize); + if (locked) + FILEDESC_SUNLOCK(efbuf-fdp); + error = sbuf_bcat(efbuf-sb, kif, kif-kf_structsize); + if (efbuf-fdp != NULL) + FILEDESC_SLOCK(efbuf-fdp); return (error); } @@ -3277,18 +3294,16 @@ kern_proc_filedesc_out(struct proc *p, { struct file *fp; struct filedesc *fdp; - struct kinfo_file *kif; + struct export_fd_buf *efbuf; struct vnode *cttyvp, *textvp, *tracevp; int64_t offset; void *data; - ssize_t remainder; int error, i; int type, refcnt, fflags; cap_rights_t fd_cap_rights; PROC_LOCK_ASSERT(p, MA_OWNED); - remainder = maxlen; /* ktrace vnode */ tracevp = p-p_tracevp; if (tracevp != NULL) @@ -3306,46 +3321,44 @@ kern_proc_filedesc_out(struct proc *p, } fdp = fdhold(p); PROC_UNLOCK(p); - kif = malloc(sizeof(*kif), M_TEMP, M_WAITOK); + efbuf = malloc(sizeof(*efbuf), M_TEMP, M_WAITOK); + efbuf-fdp = NULL; + efbuf-sb = sb; + efbuf-remainder = maxlen; if (tracevp != NULL) export_fd_to_sb(tracevp, KF_TYPE_VNODE, KF_FD_TYPE_TRACE, - FREAD | FWRITE, -1, -1, 0, kif, sb, remainder); + FREAD | FWRITE, -1, -1, 0, efbuf); if (textvp != NULL) export_fd_to_sb(textvp, KF_TYPE_VNODE, KF_FD_TYPE_TEXT, - FREAD, -1, -1, 0, kif, sb, remainder); + FREAD, -1, -1, 0, efbuf); if (cttyvp != NULL) export_fd_to_sb(cttyvp, KF_TYPE_VNODE, KF_FD_TYPE_CTTY, - FREAD | FWRITE, -1, -1, 0, kif, sb, remainder); + FREAD | FWRITE, -1, -1, 0, efbuf); error = 0; if (fdp == NULL)
svn commit: r252351 - head/sys/kern
Author: mjg Date: Fri Jun 28 18:32:46 2013 New Revision: 252351 URL: http://svnweb.freebsd.org/changeset/base/252351 Log: Remove duplicate NULL check in kern_proc_filedesc_out. No functional changes. MFC after:1 week Modified: head/sys/kern/kern_descrip.c Modified: head/sys/kern/kern_descrip.c == --- head/sys/kern/kern_descrip.cFri Jun 28 18:25:04 2013 (r252350) +++ head/sys/kern/kern_descrip.cFri Jun 28 18:32:46 2013 (r252351) @@ -3446,9 +3446,8 @@ kern_proc_filedesc_out(struct proc *p, break; } FILEDESC_SUNLOCK(fdp); + fddrop(fdp); fail: - if (fdp != NULL) - fddrop(fdp); free(efbuf, M_TEMP); return (error); } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252352 - head/sys/fs/smbfs
Author: davide Date: Fri Jun 28 20:07:24 2013 New Revision: 252352 URL: http://svnweb.freebsd.org/changeset/base/252352 Log: Plug a couple of leakages in smbfs_lookup(). Modified: head/sys/fs/smbfs/smbfs_vnops.c Modified: head/sys/fs/smbfs/smbfs_vnops.c == --- head/sys/fs/smbfs/smbfs_vnops.c Fri Jun 28 18:32:46 2013 (r252351) +++ head/sys/fs/smbfs/smbfs_vnops.c Fri Jun 28 20:07:24 2013 (r252352) @@ -1282,11 +1282,14 @@ smbfs_lookup(ap) error = vfs_busy(mp, 0); vn_lock(dvp, LK_EXCLUSIVE | LK_RETRY); vfs_rel(mp); - if (error) - return (ENOENT); + if (error) { + error = ENOENT; + goto out; + } if ((dvp-v_iflag VI_DOOMED) != 0) { vfs_unbusy(mp); - return (ENOENT); + error = ENOENT; + goto out; } } VOP_UNLOCK(dvp, 0); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252353 - head/sys/fs/smbfs
Author: davide Date: Fri Jun 28 20:14:30 2013 New Revision: 252353 URL: http://svnweb.freebsd.org/changeset/base/252353 Log: Garbage collect an useless check. smp should be never NULL. Modified: head/sys/fs/smbfs/smbfs_vfsops.c Modified: head/sys/fs/smbfs/smbfs_vfsops.c == --- head/sys/fs/smbfs/smbfs_vfsops.cFri Jun 28 20:07:24 2013 (r252352) +++ head/sys/fs/smbfs/smbfs_vfsops.cFri Jun 28 20:14:30 2013 (r252353) @@ -324,11 +324,6 @@ smbfs_root(struct mount *mp, int flags, td = curthread; cred = td-td_ucred; - if (smp == NULL) { - SMBERROR(smp == NULL (bug in umount)\n); - vfs_mount_error(mp, smp == NULL (bug in umount)); - return EINVAL; - } if (smp-sm_root) { *vpp = SMBTOV(smp-sm_root); return vget(*vpp, LK_EXCLUSIVE | LK_RETRY, td); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252354 - head/sys/netsmb
Author: davide Date: Fri Jun 28 20:21:13 2013 New Revision: 252354 URL: http://svnweb.freebsd.org/changeset/base/252354 Log: Remove a reference to LK_DRAIN now that lockmgr(9) is gone from this piece of code. Reported by: attilio Modified: head/sys/netsmb/smb_conn.c Modified: head/sys/netsmb/smb_conn.c == --- head/sys/netsmb/smb_conn.c Fri Jun 28 20:14:30 2013(r252353) +++ head/sys/netsmb/smb_conn.c Fri Jun 28 20:21:13 2013(r252354) @@ -530,7 +530,6 @@ smb_vc_free(struct smb_connobj *cp) /* * Called when use count of VC dropped to zero. - * VC should be locked on enter with LK_DRAIN. */ static void smb_vc_gone(struct smb_connobj *cp, struct smb_cred *scred) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252355 - head/sys/fs/smbfs
Author: davide Date: Fri Jun 28 20:32:48 2013 New Revision: 252355 URL: http://svnweb.freebsd.org/changeset/base/252355 Log: Properly use v_data field. This magically worked (even if wrong) until now because v_data is the first field of the structure, but it's not something we should rely on. Modified: head/sys/fs/smbfs/smbfs_node.c Modified: head/sys/fs/smbfs/smbfs_node.c == --- head/sys/fs/smbfs/smbfs_node.c Fri Jun 28 20:21:13 2013 (r252354) +++ head/sys/fs/smbfs/smbfs_node.c Fri Jun 28 20:32:48 2013 (r252355) @@ -89,7 +89,7 @@ smbfs_vnode_cmp(struct vnode *vp, void * struct smbnode *np; struct smbcmp *sc; - np = (struct smbnode *) vp; + np = (struct smbnode *) vp-v_data; sc = (struct smbcmp *) _sc; if (np-n_parent != sc-n_parent || np-n_nmlen != sc-n_nmlen || bcmp(sc-n_name, np-n_name, sc-n_nmlen) != 0) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252356 - in head: contrib/smbfs/mount_smbfs etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/examples/etc share/mk sys/conf sys/kern sys...
Author: davide Date: Fri Jun 28 21:00:08 2013 New Revision: 252356 URL: http://svnweb.freebsd.org/changeset/base/252356 Log: - Trim an unused and bogus Makefile for mount_smbfs. - Reconnect with some minor modifications, in particular now selsocket() internals are adapted to use sbintime units after recent'ish calloutng switch. Deleted: head/contrib/smbfs/mount_smbfs/Makefile Modified: head/etc/defaults/rc.conf head/etc/mtree/BSD.include.dist head/etc/mtree/BSD.usr.dist head/include/Makefile head/lib/Makefile head/lib/libprocstat/Makefile head/lib/libprocstat/common_kvm.h head/lib/libprocstat/libprocstat.c head/rescue/rescue/Makefile head/sbin/mount/mount.8 head/sbin/mount/mount.c head/share/examples/Makefile head/share/examples/etc/README.examples head/share/mk/bsd.libnames.mk head/sys/conf/NOTES head/sys/conf/files head/sys/conf/files.amd64 head/sys/conf/files.arm head/sys/conf/files.i386 head/sys/conf/files.ia64 head/sys/conf/files.mips head/sys/conf/files.pc98 head/sys/conf/files.powerpc head/sys/conf/files.sparc64 head/sys/conf/options head/sys/kern/Make.tags.inc head/sys/kern/sys_generic.c head/sys/modules/Makefile head/sys/sys/socketvar.h head/usr.bin/Makefile.amd64 head/usr.bin/Makefile.i386 head/usr.bin/Makefile.ia64 head/usr.bin/Makefile.powerpc head/usr.bin/Makefile.sparc64 head/usr.bin/kdump/kdump.c head/usr.sbin/Makefile.amd64 head/usr.sbin/Makefile.i386 head/usr.sbin/Makefile.ia64 head/usr.sbin/Makefile.powerpc head/usr.sbin/Makefile.sparc64 Modified: head/etc/defaults/rc.conf == --- head/etc/defaults/rc.conf Fri Jun 28 20:32:48 2013(r252355) +++ head/etc/defaults/rc.conf Fri Jun 28 21:00:08 2013(r252356) @@ -88,7 +88,7 @@ fsck_y_enable=NO# Set to YES to do fs fsck_y_flags=# Additional flags for fsck -y background_fsck=YES # Attempt to run fsck in the background where possible. background_fsck_delay=60 # Time to wait (seconds) before starting the fsck. -netfs_types=nfs:NFS oldnfs:OLDNFS # Net filesystems. +netfs_types=nfs:NFS oldnfs:OLDNFS smbfs:SMB # Net filesystems. extra_netfs_types=NO # List of network extra filesystem types for delayed # mount at startup (or NO). Modified: head/etc/mtree/BSD.include.dist == --- head/etc/mtree/BSD.include.dist Fri Jun 28 20:32:48 2013 (r252355) +++ head/etc/mtree/BSD.include.dist Fri Jun 28 21:00:08 2013 (r252356) @@ -176,6 +176,8 @@ .. procfs .. +smbfs +.. udf .. unionfs Modified: head/etc/mtree/BSD.usr.dist == --- head/etc/mtree/BSD.usr.dist Fri Jun 28 20:32:48 2013(r252355) +++ head/etc/mtree/BSD.usr.dist Fri Jun 28 21:00:08 2013(r252356) @@ -309,6 +309,10 @@ srcs .. .. +smbfs +print +.. +.. sunrpc dir .. Modified: head/include/Makefile == --- head/include/Makefile Fri Jun 28 20:32:48 2013(r252355) +++ head/include/Makefile Fri Jun 28 21:00:08 2013(r252356) @@ -37,7 +37,7 @@ LHDRS=aio.h errno.h fcntl.h linker_set. syslog.h ucontext.h LDIRS= bsm cam geom net net80211 netatalk netgraph netinet netinet6 \ - netipsec ${_netipx} netnatm \ + netipsec ${_netipx} netnatm netsmb \ nfs nfsclient nfsserver \ sys vm @@ -48,7 +48,7 @@ LSUBDIRS= cam/ata cam/scsi \ dev/ofw dev/pbio dev/pci ${_dev_powermac_nvram} dev/ppbus dev/smbus \ dev/speaker dev/usb dev/utopia dev/vkbd dev/wi \ fs/devfs fs/fdescfs fs/msdosfs fs/nandfs fs/nfs fs/nullfs \ - fs/procfs fs/udf fs/unionfs \ + fs/procfs fs/smbfs fs/udf fs/unionfs \ geom/cache geom/concat geom/eli geom/gate geom/journal geom/label \ geom/mirror geom/mountver geom/multipath geom/nop \ geom/raid geom/raid3 geom/shsec geom/stripe geom/virstor \ @@ -80,6 +80,7 @@ INCS+=iconv.h LSUBSUBDIRS+= netgraph/bluetooth/include .endif +# XXX unconditionally needed by netsmb/netbios.h #.if ${MK_IPX} != no _netipx= netipx #.endif Modified: head/lib/Makefile == --- head/lib/Makefile Fri Jun 28 20:32:48 2013(r252355) +++ head/lib/Makefile Fri Jun 28 21:00:08 2013(r252356) @@ -102,6 +102,7 @@ SUBDIR= ${SUBDIR_ORDERED} \ ${_librtld_db} \ ${_libsdp} \ ${_libsm} \ + ${_libsmb} \ ${_libsmdb} \ ${_libsmutil} \
svn commit: r252357 - head/sys/kern
Author: davide Date: Fri Jun 28 21:04:15 2013 New Revision: 252357 URL: http://svnweb.freebsd.org/changeset/base/252357 Log: Correct the comment above _sleep() function which still mentions 'timo' instead of 'sbintime_t'. Reported by: kan Modified: head/sys/kern/kern_synch.c Modified: head/sys/kern/kern_synch.c == --- head/sys/kern/kern_synch.c Fri Jun 28 21:00:08 2013(r252356) +++ head/sys/kern/kern_synch.c Fri Jun 28 21:04:15 2013(r252357) @@ -132,7 +132,7 @@ sleepinit(void) /* * General sleep call. Suspends the current thread until a wakeup is * performed on the specified identifier. The thread will then be made - * runnable with the specified priority. Sleeps at most timo/hz seconds + * runnable with the specified priority. Sleeps at most sbt units of time * (0 means no timeout). If pri includes the PCATCH flag, let signals * interrupt the sleep, otherwise ignore them while sleeping. Returns 0 if * awakened, EWOULDBLOCK if the timeout expires. If PCATCH is set and a ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r252356 - in head: contrib/smbfs/mount_smbfs etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/examples/etc share/mk sys/conf sys/kern sy
On Fri, Jun 28, 2013 at 11:00 PM, Davide Italiano dav...@freebsd.org wrote: Author: davide Date: Fri Jun 28 21:00:08 2013 New Revision: 252356 URL: http://svnweb.freebsd.org/changeset/base/252356 Log: - Trim an unused and bogus Makefile for mount_smbfs. - Reconnect with some minor modifications, in particular now selsocket() internals are adapted to use sbintime units after recent'ish calloutng switch. I've updated the page at: https://wiki.freebsd.org/NONMPSAFE_DEORBIT_VFS which reflects completition of the project and the re-insert of smbfs. During VFS Non-MPSAFE deorbit we lost the following in-kernel support: CodaFS, HPFS, NTFS, NWFS, PortalFS, XFS even if for some of those (most notably NTFS) there is an userland module for FUSE available. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252358 - head/sys/vm
Author: davide Date: Fri Jun 28 21:13:19 2013 New Revision: 252358 URL: http://svnweb.freebsd.org/changeset/base/252358 Log: Remove a spurious keg lock acquisition. Modified: head/sys/vm/uma_core.c Modified: head/sys/vm/uma_core.c == --- head/sys/vm/uma_core.c Fri Jun 28 21:04:15 2013(r252357) +++ head/sys/vm/uma_core.c Fri Jun 28 21:13:19 2013(r252358) @@ -493,7 +493,7 @@ keg_timeout(uma_keg_t keg) KEG_UNLOCK(keg); hash_free(oldhash); - KEG_LOCK(keg); + return; } } KEG_UNLOCK(keg); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252359 - head/bin/sh
Author: jilles Date: Fri Jun 28 21:47:08 2013 New Revision: 252359 URL: http://svnweb.freebsd.org/changeset/base/252359 Log: sh: Do not close(-1) if pipe() fails. Modified: head/bin/sh/eval.c Modified: head/bin/sh/eval.c == --- head/bin/sh/eval.c Fri Jun 28 21:13:19 2013(r252358) +++ head/bin/sh/eval.c Fri Jun 28 21:47:08 2013(r252359) @@ -589,7 +589,8 @@ evalpipe(union node *n) pip[1] = -1; if (lp-next) { if (pipe(pip) 0) { - close(prevfd); + if (prevfd = 0) + close(prevfd); error(Pipe call failed: %s, strerror(errno)); } } ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252360 - head/etc
Author: delphij Date: Fri Jun 28 22:25:37 2013 New Revision: 252360 URL: http://svnweb.freebsd.org/changeset/base/252360 Log: Don't attempt to do DHCP on certain interfaces, similar to what's done for ipv6_autoconfif() in r212577. MFC after:1 week Modified: head/etc/network.subr Modified: head/etc/network.subr == --- head/etc/network.subr Fri Jun 28 21:47:08 2013(r252359) +++ head/etc/network.subr Fri Jun 28 22:25:37 2013(r252360) @@ -318,6 +318,15 @@ dhcpif() local _tmpargs _arg _tmpargs=`_ifconfig_getargs $1` + case $1 in + lo[0-9]*|\ + stf[0-9]*|\ + faith[0-9]*|\ + lp[0-9]*|\ + sl[0-9]*) + return 1 + ;; + esac if noafif $1; then return 1 fi @@ -509,7 +518,7 @@ ipv6_autoconfif() _if=$1 case $_if in - lo0|\ + lo[0-9]*|\ stf[0-9]*|\ faith[0-9]*|\ lp[0-9]*|\ ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252361 - in head/sys/arm: arm include
Author: ray Date: Fri Jun 28 22:31:17 2013 New Revision: 252361 URL: http://svnweb.freebsd.org/changeset/base/252361 Log: Add identification for Cortex-A15 (R0) cores. Submitted by: Ruslan Bukin b...@bsdpad.com Modified: head/sys/arm/arm/cpufunc.c head/sys/arm/arm/identcpu.c head/sys/arm/include/armreg.h Modified: head/sys/arm/arm/cpufunc.c == --- head/sys/arm/arm/cpufunc.c Fri Jun 28 22:25:37 2013(r252360) +++ head/sys/arm/arm/cpufunc.c Fri Jun 28 22:31:17 2013(r252361) @@ -1481,7 +1481,8 @@ set_cpufuncs() cputype == CPU_ID_CORTEXA8R3 || cputype == CPU_ID_CORTEXA9R1 || cputype == CPU_ID_CORTEXA9R2 || - cputype == CPU_ID_CORTEXA9R3) { + cputype == CPU_ID_CORTEXA9R3 || + cputype == CPU_ID_CORTEXA15 ) { cpufuncs = cortexa_cpufuncs; cpu_reset_needs_v4_MMU_disable = 1; /* V4 or higher */ get_cachetype_cp15(); Modified: head/sys/arm/arm/identcpu.c == --- head/sys/arm/arm/identcpu.c Fri Jun 28 22:25:37 2013(r252360) +++ head/sys/arm/arm/identcpu.c Fri Jun 28 22:31:17 2013(r252361) @@ -248,6 +248,8 @@ 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, + generic_steppings }, { CPU_ID_SA110, CPU_CLASS_SA1, SA-110, sa110_steppings }, Modified: head/sys/arm/include/armreg.h == --- head/sys/arm/include/armreg.h Fri Jun 28 22:25:37 2013 (r252360) +++ head/sys/arm/include/armreg.h Fri Jun 28 22:31:17 2013 (r252361) @@ -153,6 +153,7 @@ #define CPU_ID_CORTEXA9R1 0x411fc090 #define CPU_ID_CORTEXA9R2 0x412fc090 #define CPU_ID_CORTEXA9R3 0x413fc090 +#define CPU_ID_CORTEXA15 0x410fc0f0 #define CPU_ID_SA110 0x4401a100 #define CPU_ID_SA1100 0x4401a110 #defineCPU_ID_TI925T 0x54029250 ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252362 - head/sys/arm/include
Author: ray Date: Fri Jun 28 22:47:33 2013 New Revision: 252362 URL: http://svnweb.freebsd.org/changeset/base/252362 Log: Bump max number of IRQs for Cortex-Ax family to cover Exynos5 requirement. Submitted by: Ruslan Bukin b...@bsdpad.com Modified: head/sys/arm/include/intr.h Modified: head/sys/arm/include/intr.h == --- head/sys/arm/include/intr.h Fri Jun 28 22:31:17 2013(r252361) +++ head/sys/arm/include/intr.h Fri Jun 28 22:47:33 2013(r252362) @@ -51,7 +51,7 @@ defined(CPU_XSCALE_IXP435) #define NIRQ 64 #elif defined(CPU_CORTEXA) -#define NIRQ 128 +#define NIRQ 160 #elif defined(CPU_ARM1136) || defined(CPU_ARM1176) #define NIRQ 128 #elif defined(SOC_MV_ARMADAXP) ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r252356 - in head: contrib/smbfs/mount_smbfs etc/defaults etc/mtree include lib lib/libprocstat rescue/rescue sbin/mount share/examples share/examples/etc share/mk sys/conf sys/kern sy
On Fri, Jun 28, 2013 at 09:00:08PM +, Davide Italiano wrote: Author: davide Date: Fri Jun 28 21:00:08 2013 New Revision: 252356 URL: http://svnweb.freebsd.org/changeset/base/252356 Log: - Trim an unused and bogus Makefile for mount_smbfs. - Reconnect with some minor modifications, in particular now selsocket() internals are adapted to use sbintime units after recent'ish calloutng switch. Modified: head/sys/kern/sys_generic.c == --- head/sys/kern/sys_generic.c Fri Jun 28 20:32:48 2013 (r252355) +++ head/sys/kern/sys_generic.c Fri Jun 28 21:00:08 2013 (r252356) @@ -1498,6 +1498,61 @@ sys_openbsd_poll(td, uap) } /* + * XXX This was created specifically to support netncp and netsmb. This + * allows the caller to specify a socket to wait for events on. It returns + * 0 if any events matched and an error otherwise. There is no way to + * determine which events fired. + */ +int +selsocket(struct socket *so, int events, struct timeval *tvp, struct thread *td) +{ + struct timeval rtv; + sbintime_t asbt, precision, rsbt; + int error; + + if (tvp != NULL) { + rtv = *tvp; + if (rtv.tv_sec 0 || rtv.tv_usec 0 || + rtv.tv_usec = 100) + return (EINVAL); + if (!timevalisset(rtv)) + asbt = 0; + else if (rtv.tv_sec = INT32_MAX) { + rsbt = tvtosbt(rtv); + precision = rsbt; + precision = tc_precexp; + if (TIMESEL(asbt, rsbt)) + asbt += tc_tick_sbt; + if (asbt = INT64_MAX - rsbt) + asbt += rsbt; + else + asbt = -1; + } else + asbt = -1; + } else + asbt = -1; + seltdinit(td); + /* + * Iterate until the timeout expires or the socket becomes ready. + */ + for (;;) { + selfdalloc(td, NULL); + error = sopoll(so, events, NULL, td); + /* error here is actually the ready events. */ + if (error) + return (0); + error = seltdwait(td, asbt, precision); + if (error) + break; + } + seltdclear(td); + /* XXX Duplicates ncp/smb behavior. */ + if (error == ERESTART) + error = 0; This if looks like it may introduce unexpected differences based on whether SA_RESTART is set for an interrupting signal. When ignoring ERESTART or EINTR like this, there is a danger of busy-waiting because once a sleep with PCATCH has returned ERESTART or EINTR, all further sleeps with PCATCH will immediately return the same until you return to the user boundary so the signal can be handled. In quick inspection, the (single) caller looks like it can handle ERESTART like EINTR. The file sys/netsmb/smb_trantcp.c does appear to contain incorrect ERESTART/EINTR handling in nbssn_recv(), which can busy-wait for the rest of the data if a signal occurs. You could mask some signals temporarily if proper ERESTART/EINTR handling would be too hard or would confuse applications that do not expect partial success or [EINTR] on regular files. The NFS client does some of these things although it contains bugs as well (such as losing the distinction between ERESTART and EINTR). + return (error); +} + +/* * Preallocate two selfds associated with 'cookie'. Some fo_poll routines * have two select sets, one for read and another for write. */ -- Jilles Tjoelker ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252363 - in head/usr.sbin/pkg_install: add create lib
Author: obrien Date: Sat Jun 29 00:37:49 2013 New Revision: 252363 URL: http://svnweb.freebsd.org/changeset/base/252363 Log: sysconf(3) returns a long, not an int. Modified: head/usr.sbin/pkg_install/add/extract.c head/usr.sbin/pkg_install/create/pl.c head/usr.sbin/pkg_install/lib/exec.c Modified: head/usr.sbin/pkg_install/add/extract.c == --- head/usr.sbin/pkg_install/add/extract.c Fri Jun 28 22:47:33 2013 (r252362) +++ head/usr.sbin/pkg_install/add/extract.c Sat Jun 29 00:37:49 2013 (r252363) @@ -110,7 +110,8 @@ extract_plist(const char *home, Package PackingList p = pkg-head; char *last_file, *prefix = NULL; char *where_args, *perm_args, *last_chdir; -int maxargs, where_count = 0, perm_count = 0, add_count; +long maxargs; +int where_count = 0, perm_count = 0, add_count; Boolean preserve; maxargs = sysconf(_SC_ARG_MAX) / 2;/* Just use half the argument space */ Modified: head/usr.sbin/pkg_install/create/pl.c == --- head/usr.sbin/pkg_install/create/pl.c Fri Jun 28 22:47:33 2013 (r252362) +++ head/usr.sbin/pkg_install/create/pl.c Sat Jun 29 00:37:49 2013 (r252363) @@ -140,7 +140,8 @@ copy_plist(const char *home, Package *pl const char *there = NULL, *mythere; char *where_args, *prefix = NULL; const char *last_chdir, *root = /; -int maxargs, where_count = 0, add_count; +long maxargs; +int where_count = 0, add_count; struct stat stb; dev_t curdir; Modified: head/usr.sbin/pkg_install/lib/exec.c == --- head/usr.sbin/pkg_install/lib/exec.cFri Jun 28 22:47:33 2013 (r252362) +++ head/usr.sbin/pkg_install/lib/exec.cSat Jun 29 00:37:49 2013 (r252363) @@ -65,7 +65,7 @@ vpipe(const char *fmt, ...) { FILE *fp; char *cmd, *rp; - int maxargs; + long maxargs; va_list args; rp = malloc(MAXPATHLEN); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252364 - head/sys/fs/ext2fs
Author: pfg Date: Sat Jun 29 01:35:28 2013 New Revision: 252364 URL: http://svnweb.freebsd.org/changeset/base/252364 Log: Bring some updates from ufs_lookup to ext2fs. r156418: Don't set IN_CHANGE and IN_UPDATE on inodes for potentially suspended file systems. This could cause deadlocks when creating snapshots. (We can't do snapshots on ext2fs but it is useful to keep things in sync). r183079: - Only set i_offset in the parent directory's i-node during a lookup for non-LOOKUP operations. - Relax a VOP assertion for a DELETE lookup. r187528: Move the code from ufs_lookup.c used to do dotdot lookup, into the helper function. It is supposed to be useful for any filesystem that has to unlock dvp to walk to the .. entry in lookup routine. MFC after:5 days Modified: head/sys/fs/ext2fs/ext2_lookup.c Modified: head/sys/fs/ext2fs/ext2_lookup.c == --- head/sys/fs/ext2fs/ext2_lookup.cSat Jun 29 00:37:49 2013 (r252363) +++ head/sys/fs/ext2fs/ext2_lookup.cSat Jun 29 01:35:28 2013 (r252364) @@ -289,9 +289,9 @@ ext2_lookup_ino(struct vnode *vdp, struc int entryoffsetinblock; /* offset of ep in bp's buffer */ enum {NONE, COMPACT, FOUND} slotstatus; doff_t slotoffset; /* offset of area with free space */ - int slotsize; /* size of area at slotoffset */ doff_t i_diroff;/* cached i_diroff value */ doff_t i_offset;/* cached i_offset value */ + int slotsize; /* size of area at slotoffset */ int slotfreespace; /* amount of space free in slot */ int slotneeded; /* size of the entry we're seeking */ int numdirpasses; /* strategy for directory search */ @@ -476,7 +476,6 @@ searchloop: endsearch = i_diroff; goto searchloop; } - dp-i_offset = i_offset; if (bp != NULL) brelse(bp); /* @@ -512,7 +511,6 @@ searchloop: enduseful = slotoffset + slotsize; } dp-i_endoff = roundup2(enduseful, DIRBLKSIZ); - dp-i_flag |= IN_CHANGE | IN_UPDATE; /* * We return with the directory locked, so that * the parameters we set up above will still be @@ -560,12 +558,13 @@ found: */ if ((flags ISLASTCN) nameiop == LOOKUP) dp-i_diroff = i_offset ~ (DIRBLKSIZ - 1); - dp-i_offset = i_offset; /* * If deleting, and at end of pathname, return * parameters which can be used to remove file. */ if (nameiop == DELETE (flags ISLASTCN)) { + if (flags LOCKPARENT) + ASSERT_VOP_ELOCKED(vdp, __FUNCTION__); /* * Write access to directory required to delete files. */ @@ -576,7 +575,13 @@ found: * and distance past previous entry (if there * is a previous entry in this block) in dp-i_count. * Save directory inode pointer in ndp-ni_dvp for dirremove(). +* +* Technically we shouldn't be setting these in the +* WANTPARENT case (first lookup in rename()), but any +* lookups that will result in directory changes will +* overwrite these. */ + dp-i_offset = i_offset; if ((dp-i_offset (DIRBLKSIZ - 1)) == 0) dp-i_count = 0; else @@ -621,6 +626,7 @@ found: * Careful about locking second inode. * This can only occur if the target is .. */ + dp-i_offset = i_offset; if (dp-i_number == ino) return (EISDIR); if (dd_ino != NULL) @@ -656,10 +662,7 @@ found: */ pdp = vdp; if (flags ISDOTDOT) { - ltype = VOP_ISLOCKED(pdp); - VOP_UNLOCK(pdp, 0); /* race to get the inode */ - error = VFS_VGET(vdp-v_mount, ino, cnp-cn_lkflags, tdp); - vn_lock(pdp, ltype | LK_RETRY); + error = vn_vget_ino(pdp, ino, cnp-cn_lkflags, tdp); if (pdp-v_iflag VI_DOOMED) { if (error == 0) vput(tdp); ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252367 - head/sys/kern
Author: peter Date: Sat Jun 29 04:35:04 2013 New Revision: 252367 URL: http://svnweb.freebsd.org/changeset/base/252367 Log: Help out gcc. clang understands. sys_generic.c:1510: warning: 'precision' may be used uninitialized *** [sys_generic.o] Error code 1 Modified: head/sys/kern/sys_generic.c head/sys/kern/vfs_init.c Modified: head/sys/kern/sys_generic.c == --- head/sys/kern/sys_generic.c Sat Jun 29 04:27:04 2013(r252366) +++ head/sys/kern/sys_generic.c Sat Jun 29 04:35:04 2013(r252367) @@ -1510,6 +1510,7 @@ selsocket(struct socket *so, int events, sbintime_t asbt, precision, rsbt; int error; + precision = 0; /* stupid gcc! */ if (tvp != NULL) { rtv = *tvp; if (rtv.tv_sec 0 || rtv.tv_usec 0 || Modified: head/sys/kern/vfs_init.c == --- head/sys/kern/vfs_init.cSat Jun 29 04:27:04 2013(r252366) +++ head/sys/kern/vfs_init.cSat Jun 29 04:35:04 2013(r252367) @@ -201,6 +201,7 @@ vfs_register(struct vfsconf *vfc) } else vfc-vfc_typenum = maxvfsconf++; TAILQ_INSERT_TAIL(vfsconf, vfc, vfc_list); + vfc-vfc_flags |= VFCF_JAIL; /* * If this filesystem has a sysctl node under vfs ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
Re: svn commit: r252367 - head/sys/kern
On Jun 28, 2013, at 9:35 PM, Peter Wemm wrote: Author: peter Date: Sat Jun 29 04:35:04 2013 New Revision: 252367 URL: http://svnweb.freebsd.org/changeset/base/252367 Log: Help out gcc. clang understands. sys_generic.c:1510: warning: 'precision' may be used uninitialized *** [sys_generic.o] Error code 1 ... Modified: head/sys/kern/vfs_init.c == --- head/sys/kern/vfs_init.c Sat Jun 29 04:27:04 2013(r252366) +++ head/sys/kern/vfs_init.c Sat Jun 29 04:35:04 2013(r252367) @@ -201,6 +201,7 @@ vfs_register(struct vfsconf *vfc) } else vfc-vfc_typenum = maxvfsconf++; TAILQ_INSERT_TAIL(vfsconf, vfc, vfc_list); + vfc-vfc_flags |= VFCF_JAIL; Was this portion of the diff intentional? ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org
svn commit: r252368 - head/sys/kern
Author: peter Date: Sat Jun 29 05:05:57 2013 New Revision: 252368 URL: http://svnweb.freebsd.org/changeset/base/252368 Log: Revert accidental commit. Pointy hat to: peter Modified: head/sys/kern/vfs_init.c Modified: head/sys/kern/vfs_init.c == --- head/sys/kern/vfs_init.cSat Jun 29 04:35:04 2013(r252367) +++ head/sys/kern/vfs_init.cSat Jun 29 05:05:57 2013(r252368) @@ -201,7 +201,6 @@ vfs_register(struct vfsconf *vfc) } else vfc-vfc_typenum = maxvfsconf++; TAILQ_INSERT_TAIL(vfsconf, vfc, vfc_list); - vfc-vfc_flags |= VFCF_JAIL; /* * If this filesystem has a sysctl node under vfs ___ svn-src-head@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-head To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org