Re: svn commit: r244585 - in head: . sys/geom/label
On 2013-01-09, Warner Losh wrote: > > I do not object, but IMHO having names with the spaces in /dev is weird > > and possibly problematic. I agree and my my preference was also to disallow spaces. However I expected that someone might complain. > > This was the reason of my initial request to > > disable spaces, together with the fact that it changes the devctl(4) > > protocol (there might be other /dev/devctl readers besides devd). > > I'm not sure that the protocol changes are quire right yet... Just for the record, usb(4) already uses quoted values for certain devctl variables. See usb_notify_addq() in sys/dev/usb/usb_device.c. -- Jaakko ___ 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: r245296 - head/sys/vm
Author: zont Date: Fri Jan 11 09:58:35 2013 New Revision: 245296 URL: http://svnweb.freebsd.org/changeset/base/245296 Log: - Improve readability of sys_obreak(). Suggested by: alc Reviewed by: alc Approved by: kib (mentor) MFC after:1 week Modified: head/sys/vm/vm_unix.c Modified: head/sys/vm/vm_unix.c == --- head/sys/vm/vm_unix.c Fri Jan 11 09:27:24 2013(r245295) +++ head/sys/vm/vm_unix.c Fri Jan 11 09:58:35 2013(r245296) @@ -76,6 +76,7 @@ sys_obreak(td, uap) struct obreak_args *uap; { struct vmspace *vm = td->td_proc->p_vmspace; + vm_map_t map = &vm->vm_map; vm_offset_t new, old, base; rlim_t datalim, lmemlim, vmemlim; int prot, rv; @@ -90,7 +91,7 @@ sys_obreak(td, uap) do_map_wirefuture = FALSE; new = round_page((vm_offset_t)uap->nsize); - vm_map_lock(&vm->vm_map); + vm_map_lock(map); base = round_page((vm_offset_t) vm->vm_daddr); old = base + ctob(vm->vm_dsize); @@ -103,7 +104,7 @@ sys_obreak(td, uap) error = ENOMEM; goto done; } - if (new > vm_map_max(&vm->vm_map)) { + if (new > vm_map_max(map)) { error = ENOMEM; goto done; } @@ -117,14 +118,14 @@ sys_obreak(td, uap) goto done; } if (new > old) { - if (!old_mlock && vm->vm_map.flags & MAP_WIREFUTURE) { - if (ptoa(pmap_wired_count(vm->vm_map.pmap)) + + if (!old_mlock && map->flags & MAP_WIREFUTURE) { + if (ptoa(pmap_wired_count(map->pmap)) + (new - old) > lmemlim) { error = ENOMEM; goto done; } } - if (vm->vm_map.size + (new - old) > vmemlim) { + if (map->size + (new - old) > vmemlim) { error = ENOMEM; goto done; } @@ -137,22 +138,21 @@ sys_obreak(td, uap) goto done; } error = racct_set(td->td_proc, RACCT_VMEM, - vm->vm_map.size + (new - old)); + map->size + (new - old)); if (error != 0) { racct_set_force(td->td_proc, RACCT_DATA, old - base); PROC_UNLOCK(td->td_proc); error = ENOMEM; goto done; } - if (!old_mlock && vm->vm_map.flags & MAP_WIREFUTURE) { + if (!old_mlock && map->flags & MAP_WIREFUTURE) { error = racct_set(td->td_proc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(vm->vm_map.pmap)) + - (new - old)); + ptoa(pmap_wired_count(map->pmap)) + (new - old)); if (error != 0) { racct_set_force(td->td_proc, RACCT_DATA, old - base); racct_set_force(td->td_proc, RACCT_VMEM, - vm->vm_map.size); + map->size); PROC_UNLOCK(td->td_proc); error = ENOMEM; goto done; @@ -167,16 +167,15 @@ sys_obreak(td, uap) prot |= VM_PROT_EXECUTE; #endif #endif - rv = vm_map_insert(&vm->vm_map, NULL, 0, old, new, - prot, VM_PROT_ALL, 0); + rv = vm_map_insert(map, NULL, 0, old, new, prot, VM_PROT_ALL, 0); if (rv != KERN_SUCCESS) { #ifdef RACCT PROC_LOCK(td->td_proc); racct_set_force(td->td_proc, RACCT_DATA, old - base); - racct_set_force(td->td_proc, RACCT_VMEM, vm->vm_map.size); - if (!old_mlock && vm->vm_map.flags & MAP_WIREFUTURE) { + racct_set_force(td->td_proc, RACCT_VMEM, map->size); + if (!old_mlock && map->flags & MAP_WIREFUTURE) { racct_set_force(td->td_proc, RACCT_MEMLOCK, - ptoa(pmap_wired_count(vm->vm_map.pmap))); + ptoa(pmap_wired_count(map->pmap))); } PROC_UNLOCK(td->td_proc); #endif @@ -193,13 +192,13 @@ sys_obreak(td, uap) * * XXX If the pages cannot be wired, no error is returned. */ - if ((vm->vm_map.flags & MAP_WIREFUTURE) == MAP_WIREFUTURE) { + if ((map->flags & MAP_WIREFUTURE) == MAP_WIREFUTURE)
svn commit: r245297 - head/sys/dev/wbwd
Author: delphij Date: Fri Jan 11 10:22:09 2013 New Revision: 245297 URL: http://svnweb.freebsd.org/changeset/base/245297 Log: Add ID for Nuvoton WPCM450RA0BX found on Supermicro X9SCA-F motherboards. While I'm there, also make this driver to attach to devices that have an unknown device ID. MFC after:1 month Modified: head/sys/dev/wbwd/wbwd.c Modified: head/sys/dev/wbwd/wbwd.c == --- head/sys/dev/wbwd/wbwd.cFri Jan 11 09:58:35 2013(r245296) +++ head/sys/dev/wbwd/wbwd.cFri Jan 11 10:22:09 2013(r245297) @@ -179,6 +179,12 @@ struct winbond_vendor_device_id { .device_rev = 0x73, .descr = "Winbond 83627DHG-P", }, + { + .vendor_id = 0x5ca3, + .device_id = 0xc3, + .device_rev = 0x33, + .descr = "Nuvoton WPCM450RA0BX", + }, }; static void @@ -596,6 +602,9 @@ wb_probe_enable(device_t dev, int probe) goto cleanup; } + if (dev_id == 0xff && dev_rev == 0xff) + goto cleanup; + for (j = 0; j < sizeof(wb_devs) / sizeof(*wb_devs); j++) { if (wb_devs[j].device_id == dev_id && wb_devs[j].device_rev == dev_rev) { @@ -605,6 +614,16 @@ wb_probe_enable(device_t dev, int probe) break; } } + + if (!found) { + if (probe && dev != NULL) { + device_set_desc(dev, "Unknown Winbond/Nuvoton model"); + device_printf(dev, "DevID 0x%02x DevRev 0x%02x, " + "please report this.\n", dev_id, dev_rev); + } + found++; + } + if (probe && found && bootverbose && dev != NULL) device_printf(dev, "%s EFER 0x%02x ID 0x%02x Rev 0x%02x" " CR26 0x%02x (probing)\n", device_get_desc(dev), ___ 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: r243631 - in head/sys: kern sys
On Tue, Jan 8, 2013 at 3:12 AM, Andre Oppermann wrote: > On 07.01.2013 20:32, Alan Cox wrote: >> >> On 01/07/2013 12:47, Oleksandr Tymoshenko wrote: >>> >>> On 12/27/2012 6:46 PM, Oleksandr Tymoshenko wrote: On 12/18/2012 1:59 AM, Alan Cox wrote: > > On 12/17/2012 23:40, Oleksandr Tymoshenko wrote: >> >> On 2012-12-08, at 1:21 PM, Alan Cox wrote: >> >>> On 12/08/2012 14:32, Andre Oppermann wrote: >> >> .. skipped .. >> The trouble seems to come from NSFBUFS which is (512 + maxusers * 16) resulting in a kernel map of (512 + 400 * 16) * PAGE_SIZE = 27MB. This seem to be pushing it with the smaller ARM kmap layout. Does it boot and run when you set the tunable kern.ipc.nsfbufs=3500? ARM does have a direct map mode as well which doesn't require the allocation of sfbufs. I'm not sure which other problems that approach has. >>> Only a few (3?) platforms use it. It reduces the size of the user >>> address space, and translation between physical addresses and >>> direct map >>> addresses is not computationally trivial as it is on other >>> architectures, e.g., amd64, ia64. However, it does try to use large >>> page mappings. >>> >>> Hopefully alc@ (added to cc) can answer that and also why the kmap of 27MB manages to wrench the ARM kernel. >>> Arm does not define caps on either the buffer map size (param.h) >>> or the >>> kmem map size (vmparam.h). It would probably make sense to copy >>> these >>> definitions from i386. >> >> Adding caps didn't help. I did some digging and found out that >> although address range >> 0xc000 .. 0x is indeed valid for ARM in general actual >> KVA space varies for >> each specific hardware platform. This "real" KVA is defined by >> >> pair and ifI use them instead of > VM_MAX_KERNEL_ADDRESS> >> in init_param2 function my pandaboard successfully boots. Since >> former pair is used for defining >> kernel_map boundaries I believe it should be used for auto tuning >> as well. > > > That makes sense. However, "virtual_avail" isn't the start of the > kernel address space. The kernel map always starts at > VM_MIN_KERNEL_ADDRESS. (See kmem_init().) "virtual_avail" represents > the next unallocated virtual address in the kernel address space at an > early point in initialization. "virtual_avail" and "virtual_end" > aren't > used after that, or outside the VM system. Please use > vm_map_min(kernel_map) and vm_map_max(kernel_map) instead. I checked: kernel_map is not available (NULL) at this point. So we can't use it to determine real KVA size. Closest thing we can get is virtual_avail/virtual_end pair. Andre, could you approve attached patch for commit or suggest better solution? >>> >>> >>> Any update on this one? Can I proceed with commit? >>> >> >> Sorry, I've been away from my e-mail since the 30th, and I'm now in the >> process of getting caught up. Give me a day or so to look at this. I see an issue with commit on MIPS XLP platform as well. With 16 GB physical memory, the ncallout is calculated to be 538881 (since it is based on maxfiles - which is now based on the physical memory). Due to this, the callwheel allocation per cpu is 16MB (callwheelsize is 1MB). And on a 32 CPU machine, the total allocation for callouts comes to 32*16MB = 512MB. I have worked around this issue for now by increasing VM_KMEM_SIZE_MAX (which is 200MB now) - but I think a better fix is needed for this. JC. ___ 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: r245304 - head/contrib/libcxxrt
Author: theraven Date: Fri Jan 11 15:05:55 2013 New Revision: 245304 URL: http://svnweb.freebsd.org/changeset/base/245304 Log: Merge new version of libcxxrt. This brings in three fixes: - Don't treat pointers to members as pointers in catch blocks (they're usually fat pointers). - Correctly catch foreign exceptions in catchalls. - Ensure that a happens-before relationship is established when setting terminate handlers in one thread and calling them in another. Added: head/contrib/libcxxrt/atomic.h - copied unchanged from r245303, vendor/libcxxrt/dist/atomic.h Modified: head/contrib/libcxxrt/exception.cc head/contrib/libcxxrt/memory.cc head/contrib/libcxxrt/typeinfo.h Directory Properties: head/contrib/libcxxrt/ (props changed) Copied: head/contrib/libcxxrt/atomic.h (from r245303, vendor/libcxxrt/dist/atomic.h) == --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/contrib/libcxxrt/atomic.h Fri Jan 11 15:05:55 2013 (r245304, copy of r245303, vendor/libcxxrt/dist/atomic.h) @@ -0,0 +1,29 @@ + +#ifndef __has_builtin +#define __has_builtin(x) 0 +#endif +#ifndef __has_feature +#define __has_feature(x) 0 +#endif +/** + * Swap macro that enforces a happens-before relationship with a corresponding + * ATOMIC_LOAD. + */ +#if __has_feature(cxx_atomic) +#define ATOMIC_SWAP(addr, val)\ + __atomic_exchange(addr, val, __ATOMIC_ACQ_REL) +#elif __has_builtin(__sync_swap) +#define ATOMIC_SWAP(addr, val)\ + __sync_swap(addr, val) +#else +#define ATOMIC_SWAP(addr, val)\ + __sync_lock_test_and_set(addr, val) +#endif + +#if __has_feature(cxx_atomic) +#define ATOMIC_LOAD(addr)\ + __atomic_load(addr, __ATOMIC_ACQUIRE) +#else +#define ATOMIC_LOAD(addr)\ + (__sync_synchronize(), *addr) +#endif Modified: head/contrib/libcxxrt/exception.cc == --- head/contrib/libcxxrt/exception.cc Fri Jan 11 15:01:43 2013 (r245303) +++ head/contrib/libcxxrt/exception.cc Fri Jan 11 15:05:55 2013 (r245304) @@ -32,6 +32,7 @@ #include #include "typeinfo.h" #include "dwarf_eh.h" +#include "atomic.h" #include "cxxabi.h" #pragma weak pthread_key_create @@ -155,6 +156,17 @@ struct __cxa_thread_info */ _Unwind_Exception *currentCleanup; /** +* Our state with respect to foreign exceptions. Usually none, set to +* caught if we have just caught an exception and rethrown if we are +* rethrowing it. +*/ + enum + { + none, + caught, + rethrown + } foreign_exception_state; + /** * The public part of this structure, accessible from outside of this * module. */ @@ -308,7 +320,16 @@ static void thread_cleanup(void* thread_ __cxa_thread_info *info = (__cxa_thread_info*)thread_info; if (info->globals.caughtExceptions) { - free_exception_list(info->globals.caughtExceptions); + // If this is a foreign exception, ask it to clean itself up. + if (info->foreign_exception_state != __cxa_thread_info::none) + { + _Unwind_Exception *e = (_Unwind_Exception*)info->globals.caughtExceptions; + e->exception_cleanup(_URC_FOREIGN_EXCEPTION_CAUGHT, e); + } + else + { + free_exception_list(info->globals.caughtExceptions); + } } free(thread_info); } @@ -780,7 +801,8 @@ extern "C" void __cxa_decrement_exceptio */ extern "C" void __cxa_rethrow() { - __cxa_eh_globals *globals = __cxa_get_globals(); + __cxa_thread_info *ti = thread_info_fast(); + __cxa_eh_globals *globals = &ti->globals; // Note: We don't remove this from the caught list here, because // __cxa_end_catch will be called when we unwind out of the try block. We // could probably make this faster by providing an alternative rethrow @@ -795,6 +817,15 @@ extern "C" void __cxa_rethrow() std::terminate(); } + if (ti->foreign_exception_state != __cxa_thread_info::none) + { + ti->foreign_exception_state = __cxa_thread_info::rethrown; + _Unwind_Exception *e = (_Unwind_Exception*)ex; + _Unwind_Reason_Code err = _Unwind_Resume_or_Rethrow(e); + report_failure(err, ex); + return; + } + assert(ex->handlerCount > 0 && "Rethrowing uncaught exception!"); // ex->handlerCount will be decremented in __cxa_end_catch in enclosing @@ -848,9 +879,9 @@ static bool check_type_signature(__cxa_e void *&adjustedPtr) { void *exception_ptr = (void*)(ex+1); - const std::type_info *e
svn commit: r245305 - head/lib/libc/gen
Author: brooks Date: Fri Jan 11 15:50:01 2013 New Revision: 245305 URL: http://svnweb.freebsd.org/changeset/base/245305 Log: In r244401 I accidently moved strunvis and strunvisx from version 1.0 to 1.3 breaking the libc ABI. Revert that change (breaking the ABI again for users who updated after December 18th). Modified: head/lib/libc/gen/Symbol.map Modified: head/lib/libc/gen/Symbol.map == --- head/lib/libc/gen/Symbol.mapFri Jan 11 15:05:55 2013 (r245304) +++ head/lib/libc/gen/Symbol.mapFri Jan 11 15:50:01 2013 (r245305) @@ -298,6 +298,8 @@ FBSD_1.0 { ualarm; ulimit; uname; + strunvis; + strunvisx; usleep; utime; valloc; @@ -391,8 +393,6 @@ FBSD_1.3 { snvis; strnunvis; strnunvisx; - strunvis; - strunvisx; strnvis; strnvisx; strsnvis; ___ 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: r245306 - head/sys/cam/scsi
Author: mav Date: Fri Jan 11 16:10:11 2013 New Revision: 245306 URL: http://svnweb.freebsd.org/changeset/base/245306 Log: Do not schedule periph for payload/TUR requests if reprobe is in progress to avoid sending extra READ CAPACITY requests by dastart(). Schedule periph again on reprobe completion, or otherwise it may stuck indefinitely long. This should fix USB explore thread hanging on device unplug, waiting for periph destruction. Reported by: hselasky Modified: head/sys/cam/scsi/scsi_da.c Modified: head/sys/cam/scsi/scsi_da.c == --- head/sys/cam/scsi/scsi_da.c Fri Jan 11 15:50:01 2013(r245305) +++ head/sys/cam/scsi/scsi_da.c Fri Jan 11 16:10:11 2013(r245306) @@ -1081,6 +1081,9 @@ daschedule(struct cam_periph *periph) struct da_softc *softc = (struct da_softc *)periph->softc; uint32_t prio; + if (softc->state != DA_STATE_NORMAL) + return; + /* Check if cam_periph_getccb() was called. */ prio = periph->immediate_priority; @@ -1425,10 +1428,10 @@ daasync(void *callback_arg, u_int32_t co } case AC_SCSI_AEN: softc = (struct da_softc *)periph->softc; - if (softc->state == DA_STATE_NORMAL && !softc->tur) { + if (!softc->tur) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; - xpt_schedule(periph, CAM_PRIORITY_DEV); + daschedule(periph); } } /* FALLTHROUGH */ @@ -2168,6 +2171,7 @@ dadone(struct cam_periph *periph, union struct da_softc *softc; struct ccb_scsiio *csio; u_int32_t priority; + da_ccb_state state; softc = (struct da_softc *)periph->softc; priority = done_ccb->ccb_h.pinfo.priority; @@ -2175,7 +2179,8 @@ dadone(struct cam_periph *periph, union CAM_DEBUG(periph->path, CAM_DEBUG_TRACE, ("dadone\n")); csio = &done_ccb->csio; - switch (csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) { + state = csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK; + switch (state) { case DA_CCB_BUFFER_IO: case DA_CCB_DELETE: { @@ -2273,8 +2278,7 @@ dadone(struct cam_periph *periph, union softc->outstanding_cmds); } - if ((csio->ccb_h.ccb_state & DA_CCB_TYPE_MASK) == - DA_CCB_DELETE) { + if (state == DA_CCB_DELETE) { while ((bp1 = bioq_takefirst(&softc->delete_run_queue)) != NULL) { bp1->bio_resid = bp->bio_resid; @@ -2300,7 +2304,7 @@ dadone(struct cam_periph *periph, union rdcap = NULL; rcaplong = NULL; - if (softc->state == DA_STATE_PROBE) + if (state == DA_CCB_PROBE) rdcap =(struct scsi_read_capacity_data *)csio->data_ptr; else rcaplong = (struct scsi_read_capacity_data_long *) @@ -2313,7 +2317,7 @@ dadone(struct cam_periph *periph, union u_int lbppbe; /* LB per physical block exponent. */ u_int lalba;/* Lowest aligned LBA. */ - if (softc->state == DA_STATE_PROBE) { + if (state == DA_CCB_PROBE) { block_size = scsi_4btoul(rdcap->length); maxsector = scsi_4btoul(rdcap->addr); lbppbe = 0; @@ -2426,7 +2430,7 @@ dadone(struct cam_periph *periph, union * If we tried READ CAPACITY(16) and failed, * fallback to READ CAPACITY(10). */ - if ((softc->state == DA_STATE_PROBE2) && + if ((state == DA_CCB_PROBE2) && (softc->flags & DA_FLAG_CAN_RC16) && (((csio->ccb_h.status & CAM_STATUS_MASK) == CAM_REQ_INVALID) || @@ -2506,7 +2510,8 @@ dadone(struct cam_periph *periph, union * operation. */ xpt_release_ccb(done_ccb); - softc->state = DA_STATE_NORMAL; + softc->state = DA_STATE_NORMAL; + daschedule(periph); wakeup(&softc->disk->d_mediasize); if ((softc->flags & DA_FLAG_PROBED) == 0) { softc->flags |= DA_FLAG_PROBED; @@ -2631,7 +2636,7 @@ damediapoll(void *arg) struct cam_periph *periph = arg; struct da_softc *softc = periph->softc; - if (softc->state == DA_STATE_NORMAL && !softc->tur) { +
svn commit: r245307 - head/contrib/file/Magdir
Author: obrien Date: Fri Jan 11 17:34:30 2013 New Revision: 245307 URL: http://svnweb.freebsd.org/changeset/base/245307 Log: Add support for Lua 5.2. Submitted by: skreuzer Modified: head/contrib/file/Magdir/lua Modified: head/contrib/file/Magdir/lua == --- head/contrib/file/Magdir/luaFri Jan 11 16:10:11 2013 (r245306) +++ head/contrib/file/Magdir/luaFri Jan 11 17:34:30 2013 (r245307) @@ -19,3 +19,4 @@ 0 string \033Lua Lua bytecode, >4 byte0x50version 5.0 >4 byte0x51version 5.1 +>4 byte0x52version 5.2 ___ 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: r243631 - in head/sys: kern sys
On 01/11/2013 05:38, Jayachandran C. wrote: > On Tue, Jan 8, 2013 at 3:12 AM, Andre Oppermann wrote: >> On 07.01.2013 20:32, Alan Cox wrote: >>> On 01/07/2013 12:47, Oleksandr Tymoshenko wrote: On 12/27/2012 6:46 PM, Oleksandr Tymoshenko wrote: > On 12/18/2012 1:59 AM, Alan Cox wrote: >> On 12/17/2012 23:40, Oleksandr Tymoshenko wrote: >>> On 2012-12-08, at 1:21 PM, Alan Cox wrote: >>> On 12/08/2012 14:32, Andre Oppermann wrote: >>> .. skipped .. >>> > The trouble seems to come from NSFBUFS which is (512 + maxusers * > 16) > resulting in a kernel map of (512 + 400 * 16) * PAGE_SIZE = > 27MB. This > seem to be pushing it with the smaller ARM kmap layout. > > Does it boot and run when you set the tunable kern.ipc.nsfbufs=3500? > > ARM does have a direct map mode as well which doesn't require the > allocation > of sfbufs. I'm not sure which other problems that approach has. > Only a few (3?) platforms use it. It reduces the size of the user address space, and translation between physical addresses and direct map addresses is not computationally trivial as it is on other architectures, e.g., amd64, ia64. However, it does try to use large page mappings. > Hopefully alc@ (added to cc) can answer that and also why the > kmap of > 27MB > manages to wrench the ARM kernel. > Arm does not define caps on either the buffer map size (param.h) or the kmem map size (vmparam.h). It would probably make sense to copy these definitions from i386. >>> Adding caps didn't help. I did some digging and found out that >>> although address range >>> 0xc000 .. 0x is indeed valid for ARM in general actual >>> KVA space varies for >>> each specific hardware platform. This "real" KVA is defined by >>> >>> pair and ifI use them instead of >> VM_MAX_KERNEL_ADDRESS> >>> in init_param2 function my pandaboard successfully boots. Since >>> former pair is used for defining >>> kernel_map boundaries I believe it should be used for auto tuning >>> as well. >> >> That makes sense. However, "virtual_avail" isn't the start of the >> kernel address space. The kernel map always starts at >> VM_MIN_KERNEL_ADDRESS. (See kmem_init().) "virtual_avail" represents >> the next unallocated virtual address in the kernel address space at an >> early point in initialization. "virtual_avail" and "virtual_end" >> aren't >> used after that, or outside the VM system. Please use >> vm_map_min(kernel_map) and vm_map_max(kernel_map) instead. > > I checked: kernel_map is not available (NULL) at this point. So we > can't use it to > determine real KVA size. Closest thing we can get is > virtual_avail/virtual_end pair. > > Andre, could you approve attached patch for commit or suggest better > solution? Any update on this one? Can I proceed with commit? >>> Sorry, I've been away from my e-mail since the 30th, and I'm now in the >>> process of getting caught up. Give me a day or so to look at this. > I see an issue with commit on MIPS XLP platform as well. > > With 16 GB physical memory, the ncallout is calculated to be 538881 > (since it is based on maxfiles - which is now based on the physical > memory). Due to this, the callwheel allocation per cpu is 16MB > (callwheelsize is 1MB). And on a 32 CPU machine, the total allocation > for callouts comes to 32*16MB = 512MB. > > I have worked around this issue for now by increasing VM_KMEM_SIZE_MAX > (which is 200MB now) - but I think a better fix is needed for this. > MIPS should use a definition for VM_KMEM_SIZE_MAX that scales with the kernel address space size, like amd64, i386, and sparc64, and not a fixed number. I think that the following should work for both 32- and 64-bit processors: Index: mips/include/vmparam.h === --- mips/include/vmparam.h (revision 245229) +++ mips/include/vmparam.h (working copy) @@ -130,10 +130,11 @@ #endif /* - * Ceiling on amount of kmem_map kva space. + * Ceiling on the amount of kmem_map KVA space: 40% of the entire KVA space. */ #ifndef VM_KMEM_SIZE_MAX -#defineVM_KMEM_SIZE_MAX(200 * 1024 * 1024) +#defineVM_KMEM_SIZE_MAX((VM_MAX_KERNEL_ADDRESS - \ +VM_MIN_KERNEL_ADDRESS + 1) * 2 / 5) #endif /* initial pagein size of beginning of executable file */ ___ 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: r245308 - head/lib/libc/gen
Author: brooks Date: Fri Jan 11 17:51:03 2013 New Revision: 245308 URL: http://svnweb.freebsd.org/changeset/base/245308 Log: Add contrib/libc-vis to the include path so we reliably pick up the right version of vis.h. Reported by: dim Modified: head/lib/libc/gen/Makefile.inc Modified: head/lib/libc/gen/Makefile.inc == --- head/lib/libc/gen/Makefile.inc Fri Jan 11 17:34:30 2013 (r245307) +++ head/lib/libc/gen/Makefile.inc Fri Jan 11 17:51:03 2013 (r245308) @@ -40,6 +40,7 @@ SRCS+= __getosreldate.c __xuname.c \ SRCS+= pwcache.c pwcache.h .PATH: ${.CURDIR}/../../contrib/libc-vis +CFLAGS+= -I${.CURDIR}/../../contrib/libc-vis SRCS+= unvis.c vis.c MISRCS+=modf.c ___ 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: r245309 - in head: . share/zoneinfo
Author: brooks Date: Fri Jan 11 18:37:51 2013 New Revision: 245309 URL: http://svnweb.freebsd.org/changeset/base/245309 Log: Use find -exec to install zoneinfo instead of requiring xargs to be an install tool. Suggested by: delphij Modified: head/Makefile.inc1 head/share/zoneinfo/Makefile Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Fri Jan 11 17:51:03 2013(r245308) +++ head/Makefile.inc1 Fri Jan 11 18:37:51 2013(r245309) @@ -643,7 +643,7 @@ installcheck_UGID: _install-info= install-info .endif .if ${MK_ZONEINFO} != "no" -_zoneinfo= zic tzsetup xargs +_zoneinfo= zic tzsetup .endif ITOOLS=[ awk cap_mkdb cat chflags chmod chown \ Modified: head/share/zoneinfo/Makefile == --- head/share/zoneinfo/MakefileFri Jan 11 17:51:03 2013 (r245308) +++ head/share/zoneinfo/MakefileFri Jan 11 18:37:51 2013 (r245309) @@ -79,9 +79,9 @@ zoneinfo: yearistype ${TDATA} beforeinstall: cd ${TZBUILDDIR} && \ - find . -type f -print | xargs -I _FILE_ ${INSTALL} \ + find . -type f -print -exec ${INSTALL} \ -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ - _FILE_ ${DESTDIR}/usr/share/zoneinfo/_FILE_ + \{} ${DESTDIR}/usr/share/zoneinfo/\{} \; ${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} \ ${CONTRIBDIR}/zone.tab ${DESTDIR}/usr/share/zoneinfo/ ___ 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: r245310 - head/sys/cam/scsi
Author: mav Date: Fri Jan 11 19:11:56 2013 New Revision: 245310 URL: http://svnweb.freebsd.org/changeset/base/245310 Log: - Add missig xpt_schedule() call for cases when requested immediate CCB priority is lower then payload/TUR one. - Reduce TUR priority and avoid sending them if there are any other outstanding commands, alike to DA driver. Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c == --- head/sys/cam/scsi/scsi_cd.c Fri Jan 11 18:37:51 2013(r245309) +++ head/sys/cam/scsi/scsi_cd.c Fri Jan 11 19:11:56 2013(r245310) @@ -581,7 +581,7 @@ cdasync(void *callback_arg, u_int32_t co if (softc->state == CD_STATE_NORMAL && !softc->tur) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; - xpt_schedule(periph, CAM_PRIORITY_DEV); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); } } /* FALLTHROUGH */ @@ -1612,9 +1612,11 @@ cdstart(struct cam_periph *periph, union xpt_action(start_ccb); } - if (bp != NULL || softc->tur) { + if (bp != NULL || softc->tur || + periph->immediate_priority != CAM_PRIORITY_NONE) { /* Have more work to do, so ensure we stay scheduled */ - xpt_schedule(periph, CAM_PRIORITY_NORMAL); + xpt_schedule(periph, min(CAM_PRIORITY_NORMAL, + periph->immediate_priority)); } break; } @@ -3293,10 +3295,11 @@ cdmediapoll(void *arg) if (softc->flags & CD_FLAG_CHANGER) return; - if (softc->state == CD_STATE_NORMAL && !softc->tur) { + if (softc->state == CD_STATE_NORMAL && !softc->tur && + softc->outstanding_cmds == 0) { if (cam_periph_acquire(periph) == CAM_REQ_CMP) { softc->tur = 1; - xpt_schedule(periph, CAM_PRIORITY_DEV); + xpt_schedule(periph, CAM_PRIORITY_NORMAL); } } /* Queue us up again */ ___ 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: r245311 - head/tools/build
Author: brooks Date: Fri Jan 11 20:51:02 2013 New Revision: 245311 URL: http://svnweb.freebsd.org/changeset/base/245311 Log: Add pwcache(3) and vis(3) to libegacy as install(1) is about to grow a dependency on them. Sponsored by: DARPA, AFRL Modified: head/tools/build/Makefile Modified: head/tools/build/Makefile == --- head/tools/build/Makefile Fri Jan 11 19:11:56 2013(r245310) +++ head/tools/build/Makefile Fri Jan 11 20:51:02 2013(r245311) @@ -21,6 +21,22 @@ config.h: ${.CURDIR}/../../lib/libmagic/ grep -v HAVE_GETLINE ${.ALLSRC} > ${.TARGET} .endif +_WITH_PWCACHEDB!= grep -c pwcache_groupdb /usr/include/pwd.h || true +.if ${_WITH_PWCACHEDB} == 0 +.PATH: ${.CURDIR}/../../contrib/libc-pwcache +CFLAGS+= -I${.CURDIR}/../../contrib/libc-pwcache \ + -I${.CURDIR}/../../lib/libc/include +SRCS+= pwcache.c +.endif + +_WITH_STRSVIS!=grep -c strsvis /usr/include/vis.h || true +.if ${_WITH_STRSVIS} == 0 +.PATH: ${.CURDIR}/../../contrib/libc-vis +SRCS+= vis.c +CFLAGS+= -I${.CURDIR}/../../contrib/libc-vis \ + -I${.CURDIR}/../../lib/libc/include +.endif + .if empty(SRCS) SRCS= dummy.c .endif ___ 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: r245312 - head/usr.bin/xinstall
Author: brooks Date: Fri Jan 11 20:53:28 2013 New Revision: 245312 URL: http://svnweb.freebsd.org/changeset/base/245312 Log: Implement the -N option which allows an alternate passwd and group file to be used. This is useful for installing on systems where a user or group does not currently exist. Sponsored by: DARPA, AFRL Obtained from:NetBSD MFC after:5 days Modified: head/usr.bin/xinstall/Makefile head/usr.bin/xinstall/install.1 head/usr.bin/xinstall/xinstall.c Modified: head/usr.bin/xinstall/Makefile == --- head/usr.bin/xinstall/Makefile Fri Jan 11 20:51:02 2013 (r245311) +++ head/usr.bin/xinstall/Makefile Fri Jan 11 20:53:28 2013 (r245312) @@ -3,6 +3,14 @@ PROG= xinstall PROGNAME= install +SRCS= xinstall.c getid.c MAN= install.1 +.PATH: ${.CURDIR}/../../contrib/mtree +CFLAGS+= -I${.CURDIR}/../../contrib/mtree +CFLAGS+= -I${.CURDIR}/../../lib/libnetbsd + +DPADD+=${LIBUTIL} +LDADD+=-lutil + .include Modified: head/usr.bin/xinstall/install.1 == --- head/usr.bin/xinstall/install.1 Fri Jan 11 20:51:02 2013 (r245311) +++ head/usr.bin/xinstall/install.1 Fri Jan 11 20:53:28 2013 (r245312) @@ -41,6 +41,7 @@ .Op Fl f Ar flags .Op Fl g Ar group .Op Fl m Ar mode +.Op Fl N Ar dbdir .Op Fl o Ar owner .Ar file1 file2 .Nm @@ -49,6 +50,7 @@ .Op Fl f Ar flags .Op Fl g Ar group .Op Fl m Ar mode +.Op Fl N Ar dbdir .Op Fl o Ar owner .Ar file1 ... fileN directory .Nm @@ -56,6 +58,7 @@ .Op Fl v .Op Fl g Ar group .Op Fl m Ar mode +.Op Fl N Ar dbdir .Op Fl o Ar owner .Ar directory ... .Sh DESCRIPTION @@ -124,6 +127,18 @@ The default mode is set to rwxr-xr-x (07 The specified mode may be either an octal or symbolic value; see .Xr chmod 1 for a description of possible mode values. +.It Fl N +Use the user database text file +.Pa master.passwd +and group database text file +.Pa group +from +.Ar dbdir , +rather than using the results from the system's +.Xr getpwnam 3 +and +.Xr getgrnam 3 +(and related) library calls. .It Fl o Specify an owner. A numeric UID is allowed. @@ -231,6 +246,8 @@ The default was changed to copy in .Xr mv 1 , .Xr strip 1 , .Xr mmap 2 , +.Xr getgrnam 3 , +.Xr getpwnam 3 , .Xr chown 8 .Sh HISTORY The Modified: head/usr.bin/xinstall/xinstall.c == --- head/usr.bin/xinstall/xinstall.cFri Jan 11 20:51:02 2013 (r245311) +++ head/usr.bin/xinstall/xinstall.cFri Jan 11 20:53:28 2013 (r245312) @@ -62,6 +62,8 @@ __FBSDID("$FreeBSD$"); #include #include +#include "mtree.h" + /* Bootstrap aid - this doesn't exist in most older releases */ #ifndef MAP_FAILED #define MAP_FAILED ((void *)-1)/* from */ @@ -74,8 +76,6 @@ __FBSDID("$FreeBSD$"); #defineNOCHANGEBITS(UF_IMMUTABLE | UF_APPEND | SF_IMMUTABLE | SF_APPEND) #defineBACKUP_SUFFIX ".old" -static struct passwd *pp; -static struct group *gp; static gid_t gid; static uid_t uid; static int dobackup, docompare, dodir, dopreserve, dostrip, nommap, safecopy, @@ -89,7 +89,7 @@ static intcreate_newfile(const char *, static int create_tempfile(const char *, char *, size_t); static voidinstall(const char *, const char *, u_long, u_int); static voidinstall_dir(char *); -static u_long numeric_id(const char *, const char *); +static int parseid(const char *, id_t *); static voidstrip(const char *); static int trymmap(int); static voidusage(void); @@ -107,7 +107,7 @@ main(int argc, char *argv[]) iflags = 0; group = owner = NULL; - while ((ch = getopt(argc, argv, "B:bCcdf:g:Mm:o:pSsv")) != -1) + while ((ch = getopt(argc, argv, "B:bCcdf:g:Mm:N:o:pSsv")) != -1) switch((char)ch) { case 'B': suffix = optarg; @@ -143,6 +143,11 @@ main(int argc, char *argv[]) mode = getmode(set, 0); free(set); break; + case 'N': + if (!setup_getid(optarg)) + err(1, "Unable to use user and group " + "databases in `%s'", optarg); + break; case 'o': owner = optarg; break; @@ -186,18 +191,22 @@ main(int argc, char *argv[]) /* get group and owner id's */ if (group != NULL) { - if ((gp = getgrnam(group)) != NULL) - gid = gp->gr_gid; - else - gid = (gid_t)numeric_id(group, "group"); + if (gid_from_group(group, &gid) == -1) { +
svn commit: r245313 - head/sys/sys
Author: brooks Date: Fri Jan 11 21:11:01 2013 New Revision: 245313 URL: http://svnweb.freebsd.org/changeset/base/245313 Log: Bump __FreeBSD_version for install -N and (belatedly) nmtree. Modified: head/sys/sys/param.h Modified: head/sys/sys/param.h == --- head/sys/sys/param.hFri Jan 11 20:53:28 2013(r245312) +++ head/sys/sys/param.hFri Jan 11 21:11:01 2013(r245313) @@ -58,7 +58,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 125 /* Master, propagated to newvers */ +#define __FreeBSD_version 126 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, ___ 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: r245314 - head/sys/dev/atkbdc
Author: imp Date: Fri Jan 11 21:19:45 2013 New Revision: 245314 URL: http://svnweb.freebsd.org/changeset/base/245314 Log: style(9) changes before I do more real changes. Modified: head/sys/dev/atkbdc/atkbd.c Modified: head/sys/dev/atkbdc/atkbd.c == --- head/sys/dev/atkbdc/atkbd.c Fri Jan 11 21:11:01 2013(r245313) +++ head/sys/dev/atkbdc/atkbd.c Fri Jan 11 21:19:45 2013(r245314) @@ -401,7 +401,7 @@ atkbd_init(int unit, keyboard_t **kbdp, bcopy(&key_map, keymap, sizeof(key_map)); bcopy(&accent_map, accmap, sizeof(accent_map)); bcopy(fkey_tab, fkeymap, - imin(fkeymap_size*sizeof(fkeymap[0]), sizeof(fkey_tab))); + imin(fkeymap_size * sizeof(fkeymap[0]), sizeof(fkey_tab))); kbd_set_maps(kbd, keymap, accmap, fkeymap, fkeymap_size); kbd->kb_data = (void *)state; @@ -424,8 +424,8 @@ atkbd_init(int unit, keyboard_t **kbdp, if (!KBD_IS_INITIALIZED(kbd) && !(flags & KB_CONF_PROBE_ONLY)) { kbd->kb_config = flags & ~KB_CONF_PROBE_ONLY; if (KBD_HAS_DEVICE(kbd) - && init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config) - && (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD)) { + && init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config) + && (kbd->kb_config & KB_CONF_FAIL_IF_NO_KBD)) { kbd_unregister(kbd); error = ENXIO; goto bad; @@ -485,8 +485,7 @@ atkbd_intr(keyboard_t *kbd, void *arg) * The keyboard was not detected before; * it must have been reconnected! */ - init_keyboard(state->kbdc, &kbd->kb_type, - kbd->kb_config); + init_keyboard(state->kbdc, &kbd->kb_type, kbd->kb_config); KBD_FOUND_DEVICE(kbd); atkbd_ioctl(kbd, KDSETLED, (caddr_t)&state->ks_state); get_typematic(kbd); @@ -645,7 +644,7 @@ next_code: goto next_code; } break; - case 0xE0: /* 0xE0 prefix */ + case 0xE0: /* 0xE0 prefix */ state->ks_prefix = 0; switch (keycode) { case 0x1C: /* right enter key */ @@ -655,57 +654,57 @@ next_code: keycode = 0x5A; break; case 0x35: /* keypad divide key */ - keycode = 0x5B; - break; + keycode = 0x5B; + break; case 0x37: /* print scrn key */ - keycode = 0x5C; - break; + keycode = 0x5C; + break; case 0x38: /* right alt key (alt gr) */ - keycode = 0x5D; - break; + keycode = 0x5D; + break; case 0x46: /* ctrl-pause/break on AT 101 (see below) */ keycode = 0x68; - break; + break; case 0x47: /* grey home key */ - keycode = 0x5E; - break; + keycode = 0x5E; + break; case 0x48: /* grey up arrow key */ - keycode = 0x5F; - break; + keycode = 0x5F; + break; case 0x49: /* grey page up key */ - keycode = 0x60; - break; + keycode = 0x60; + break; case 0x4B: /* grey left arrow key */ - keycode = 0x61; - break; + keycode = 0x61; + break; case 0x4D: /* grey right arrow key */ - keycode = 0x62; - break; + keycode = 0x62; + break; case 0x4F: /* grey end key */ - keycode = 0x63; - break; + keycode = 0x63; + break; case 0x50: /* grey down arrow key */ - keycode = 0x64; - break; + keycode = 0x64; + break; case 0x51: /* grey page down key */ - keycode = 0x65; - break; + keycode = 0x65; + break; case 0x52: /* grey insert key
svn commit: r245315 - head/sys/dev/atkbdc
Author: imp Date: Fri Jan 11 21:42:23 2013 New Revision: 245315 URL: http://svnweb.freebsd.org/changeset/base/245315 Log: Pass the device_t into atkbd_{probe,attach}_unit and get the controller unit and keyboard unit from there. It will be needed for other things in the future as well... Modified: head/sys/dev/atkbdc/atkbd.c head/sys/dev/atkbdc/atkbd_atkbdc.c head/sys/dev/atkbdc/atkbdreg.h Modified: head/sys/dev/atkbdc/atkbd.c == --- head/sys/dev/atkbdc/atkbd.c Fri Jan 11 21:19:45 2013(r245314) +++ head/sys/dev/atkbdc/atkbd.c Fri Jan 11 21:42:23 2013(r245315) @@ -66,7 +66,7 @@ static timeout_t atkbd_timeout; static voidatkbd_shutdown_final(void *v); int -atkbd_probe_unit(int unit, int ctlr, int irq, int flags) +atkbd_probe_unit(device_t dev, int irq, int flags) { keyboard_switch_t *sw; int args[2]; @@ -76,27 +76,29 @@ atkbd_probe_unit(int unit, int ctlr, int if (sw == NULL) return ENXIO; - args[0] = ctlr; + args[0] = device_get_unit(device_get_parent(dev)); args[1] = irq; - error = (*sw->probe)(unit, args, flags); + error = (*sw->probe)(device_get_unit(dev), args, flags); if (error) return error; return 0; } int -atkbd_attach_unit(int unit, keyboard_t **kbd, int ctlr, int irq, int flags) +atkbd_attach_unit(device_t dev, keyboard_t **kbd, int irq, int flags) { keyboard_switch_t *sw; int args[2]; int error; + int unit; sw = kbd_get_switch(ATKBD_DRIVER_NAME); if (sw == NULL) return ENXIO; /* reset, initialize and enable the device */ - args[0] = ctlr; + unit = device_get_unit(dev); + args[0] = device_get_unit(device_get_parent(dev)); args[1] = irq; *kbd = NULL; error = (*sw->probe)(unit, args, flags); Modified: head/sys/dev/atkbdc/atkbd_atkbdc.c == --- head/sys/dev/atkbdc/atkbd_atkbdc.c Fri Jan 11 21:19:45 2013 (r245314) +++ head/sys/dev/atkbdc/atkbd_atkbdc.c Fri Jan 11 21:42:23 2013 (r245315) @@ -104,9 +104,7 @@ atkbdprobe(device_t dev) bus_release_resource(dev, SYS_RES_IRQ, rid, res); /* probe the device */ - return atkbd_probe_unit(device_get_unit(dev), - device_get_unit(device_get_parent(dev)), - irq, flags); + return atkbd_probe_unit(dev, irq, flags); } static int @@ -124,9 +122,7 @@ atkbdattach(device_t dev) rid = KBDC_RID_KBD; irq = bus_get_resource_start(dev, SYS_RES_IRQ, rid); flags = device_get_flags(dev); - error = atkbd_attach_unit(device_get_unit(dev), &kbd, - device_get_unit(device_get_parent(dev)), - irq, flags); + error = atkbd_attach_unit(dev, &kbd, irq, flags); if (error) return error; Modified: head/sys/dev/atkbdc/atkbdreg.h == --- head/sys/dev/atkbdc/atkbdreg.h Fri Jan 11 21:19:45 2013 (r245314) +++ head/sys/dev/atkbdc/atkbdreg.h Fri Jan 11 21:42:23 2013 (r245315) @@ -39,9 +39,8 @@ #ifdef _KERNEL -intatkbd_probe_unit(int unit, int ctlr, int irq, int flags); -intatkbd_attach_unit(int unit, keyboard_t **kbd, -int ctlr, int irq, int flags); +intatkbd_probe_unit(device_t dev, int irq, int flags); +intatkbd_attach_unit(device_t dev, keyboard_t **kbd, int irq, int flags); #endif ___ 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: r245316 - in head: . etc
Author: brooks Date: Fri Jan 11 23:08:19 2013 New Revision: 245316 URL: http://svnweb.freebsd.org/changeset/base/245316 Log: Use the -N option to install and nmtree to eliminate the need for the checks for missing users and groups. Sponsored by: DARPA, AFRL Modified: head/Makefile.inc1 head/etc/Makefile Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Fri Jan 11 21:42:23 2013(r245315) +++ head/Makefile.inc1 Fri Jan 11 23:08:19 2013(r245316) @@ -340,12 +340,14 @@ LIB32WMAKEFLAGS+= \ LIB32WMAKE=${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \ -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML -LIB32IMAKE=${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS +LIB32IMAKE=${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS \ + INSTALL="install -N ${.CURDIR}/etc" .endif -# install stage IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} -IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 +IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ + INSTALL="install -N ${.CURDIR}/etc" \ + MTREE_CMD="nmtree -N ${.CURDIR}/etc" .if empty(.MAKEFLAGS:M-n) IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ LD_LIBRARY_PATH=${INSTALLTMP} \ @@ -609,34 +611,6 @@ installcheck_DESTDIR: .endif # -# Check for missing UIDs/GIDs. -# -CHECK_UIDS=auditdistd -CHECK_GIDS=audit -.if ${MK_SENDMAIL} != "no" -CHECK_UIDS+= smmsp -CHECK_GIDS+= smmsp -.endif -.if ${MK_PF} != "no" -CHECK_UIDS+= proxy -CHECK_GIDS+= proxy authpf -.endif -installcheck: installcheck_UGID -installcheck_UGID: -.for uid in ${CHECK_UIDS} - @if ! `id -u ${uid} >/dev/null 2>&1`; then \ - echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \ - false; \ - fi -.endfor -.for gid in ${CHECK_GIDS} - @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \ - echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \ - false; \ - fi -.endfor - -# # Required install tools to be saved in a scratch dir for safety. # .if ${MK_INFO} != "no" @@ -692,6 +666,7 @@ distributeworld installworld: installche done); \ cp $$libs $$progs ${INSTALLTMP} cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale + rm -f ${METALOG} .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} -mkdir ${DESTDIR}/${DISTDIR}/${dist} @@ -753,7 +728,8 @@ redistribute: .endif distrib-dirs distribution: - cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET} + cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ + INSTALL="install -N ${.CURDIR}/etc" ${.TARGET} # # buildkernel and installkernel @@ -1059,6 +1035,11 @@ _lex=usr.bin/lex _yacc= usr.bin/yacc .endif +.if ${BOOTSTRAPPING} < 126 +_nmtree= lib/libnetbsd \ + usr.sbin/nmtree +.endif + .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 _awk= usr.bin/awk .endif @@ -1120,7 +1101,8 @@ bootstrap-tools: ${_lex} \ usr.bin/xinstall \ ${_gensnmptree} \ -usr.sbin/config +usr.sbin/config \ +${_nmtree} ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ Modified: head/etc/Makefile == --- head/etc/Makefile Fri Jan 11 21:42:23 2013(r245315) +++ head/etc/Makefile Fri Jan 11 23:08:19 2013(r245316) @@ -291,25 +291,27 @@ distribution: ${DESTDIR}/etc/nsswitch.conf .endif +MTREE_CMD?=mtree + distrib-dirs: - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr - mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \ + ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ + ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var + ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr + ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \ -p ${DESTDIR}/usr/include .if ${MK_BIND_LIBS} != "no" - mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \ + ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \ -p ${DESTDIR}/usr/include .endif .if ${MK_BIND_MTREE} != "no" - mtree
Re: svn commit: r245316 - in head: . etc
On Fri, Jan 11, 2013 at 3:08 PM, Brooks Davis wrote: > -IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 > +IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ > + INSTALL="install -N ${.CURDIR}/etc" \ > + MTREE_CMD="nmtree -N ${.CURDIR}/etc" How does this work with worlds with different UID/GID assignments? Eg: the freebsd.org cluster? ${.CURDIR}/etc/master.passwd does not match the installed system. -- Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV bitcoin:188ZjyYLFJiEheQZw4UtU27e2FMLmuRBUE ___ 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: r245316 - in head: . etc
On Fri, Jan 11, 2013 at 3:19 PM, Peter Wemm wrote: > On Fri, Jan 11, 2013 at 3:08 PM, Brooks Davis wrote: > >> -IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 >> +IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ >> + INSTALL="install -N ${.CURDIR}/etc" \ >> + MTREE_CMD="nmtree -N ${.CURDIR}/etc" > > How does this work with worlds with different UID/GID assignments? > Eg: the freebsd.org cluster? > > ${.CURDIR}/etc/master.passwd does not match the installed system. Case in point, the freebsd.org cluster has used postfix before sendmail gained its privilege separation. We had: postfix:*:25:postfix postdrop:*:26: .. long before sendmail added: smmsp:*:25: mailnull:*:26: On an existing machine we have: -r-xr-sr-x 1 root smmsp 719336 Jan 6 15:13 /usr/libexec/sendmail/sendmail But on the freebsd.org machines that have machines dating back to 1998, this change would cause: -r-xr-sr-x 1 root postfix 719336 Jan 6 15:13 /usr/libexec/sendmail/sendmail With a silent change like that, if the admin doesn't notice.. who can tell what would happen? Silently giving sendmail setgid access to another subsystem's gid is.. just POLA violation at every conceivable level and potentially dangerous. These tools from netbsd were meant for cross compiling.. ie: when DESTDIR != /. -- Peter Wemm - pe...@wemm.org; pe...@freebsd.org; pe...@yahoo-inc.com; KI6FJV bitcoin:188ZjyYLFJiEheQZw4UtU27e2FMLmuRBUE ___ 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: r245317 - head/sys/pc98/cbus
Author: imp Date: Fri Jan 11 23:42:24 2013 New Revision: 245317 URL: http://svnweb.freebsd.org/changeset/base/245317 Log: MFi386: Make similar changes that were made to atkbdc in r245315. Modified: head/sys/pc98/cbus/pckbd.c Modified: head/sys/pc98/cbus/pckbd.c == --- head/sys/pc98/cbus/pckbd.c Fri Jan 11 23:08:19 2013(r245316) +++ head/sys/pc98/cbus/pckbd.c Fri Jan 11 23:42:24 2013(r245317) @@ -77,9 +77,9 @@ DRIVER_MODULE(pckbd, isa, pckbd_driver, static bus_addr_t pckbd_iat[] = {0, 2}; -static int pckbd_probe_unit(int unit, int port, int irq, +static int pckbd_probe_unit(device_t dev, int port, int irq, int flags); -static int pckbd_attach_unit(int unit, keyboard_t **kbd, +static int pckbd_attach_unit(device_t dev, keyboard_t **kbd, int port, int irq, int flags); static timeout_t pckbd_timeout; @@ -103,7 +103,7 @@ pckbdprobe(device_t dev) return ENXIO; isa_load_resourcev(res, pckbd_iat, 2); - error = pckbd_probe_unit(device_get_unit(dev), + error = pckbd_probe_unit(dev, isa_get_port(dev), (1 << isa_get_irq(dev)), device_get_flags(dev)); @@ -128,7 +128,7 @@ pckbdattach(device_t dev) return ENXIO; isa_load_resourcev(res, pckbd_iat, 2); - error = pckbd_attach_unit(device_get_unit(dev), &kbd, + error = pckbd_attach_unit(dev, &kbd, isa_get_port(dev), (1 << isa_get_irq(dev)), device_get_flags(dev)); @@ -164,7 +164,7 @@ pckbd_isa_intr(void *arg) } static int -pckbd_probe_unit(int unit, int port, int irq, int flags) +pckbd_probe_unit(device_t dev, int port, int irq, int flags) { keyboard_switch_t *sw; int args[2]; @@ -176,24 +176,26 @@ pckbd_probe_unit(int unit, int port, int args[0] = port; args[1] = irq; - error = (*sw->probe)(unit, args, flags); + error = (*sw->probe)(device_get_unit(dev), args, flags); if (error) return error; return 0; } static int -pckbd_attach_unit(int unit, keyboard_t **kbd, int port, int irq, int flags) +pckbd_attach_unit(device_t dev, keyboard_t **kbd, int port, int irq, int flags) { keyboard_switch_t *sw; int args[2]; int error; + int unit; sw = kbd_get_switch(DRIVER_NAME); if (sw == NULL) return ENXIO; /* reset, initialize and enable the device */ + unit = device_get_unit(dev); args[0] = port; args[1] = irq; *kbd = 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"
svn commit: r245318 - in head: . etc
Author: brooks Date: Fri Jan 11 23:44:35 2013 New Revision: 245318 URL: http://svnweb.freebsd.org/changeset/base/245318 Log: Revert r245316. Systems with non-standard uids/gids are more prevalent that I'd feared. Discussion is ongoing about the scope of a safer solution. Modified: head/Makefile.inc1 head/etc/Makefile Modified: head/Makefile.inc1 == --- head/Makefile.inc1 Fri Jan 11 23:42:24 2013(r245317) +++ head/Makefile.inc1 Fri Jan 11 23:44:35 2013(r245318) @@ -340,14 +340,12 @@ LIB32WMAKEFLAGS+= \ LIB32WMAKE=${LIB32WMAKEENV} ${MAKE} ${LIB32WMAKEFLAGS} \ -DWITHOUT_BIND -DWITHOUT_MAN -DWITHOUT_INFO -DWITHOUT_HTML -LIB32IMAKE=${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS \ - INSTALL="install -N ${.CURDIR}/etc" +LIB32IMAKE=${LIB32WMAKE:NINSTALL=*:NDESTDIR=*:N_LDSCRIPTROOT=*} -DNO_INCS .endif +# install stage IMAKEENV= ${CROSSENV:N_LDSCRIPTROOT=*} -IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ - INSTALL="install -N ${.CURDIR}/etc" \ - MTREE_CMD="nmtree -N ${.CURDIR}/etc" +IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 .if empty(.MAKEFLAGS:M-n) IMAKEENV+= PATH=${STRICTTMPPATH}:${INSTALLTMP} \ LD_LIBRARY_PATH=${INSTALLTMP} \ @@ -611,6 +609,34 @@ installcheck_DESTDIR: .endif # +# Check for missing UIDs/GIDs. +# +CHECK_UIDS=auditdistd +CHECK_GIDS=audit +.if ${MK_SENDMAIL} != "no" +CHECK_UIDS+= smmsp +CHECK_GIDS+= smmsp +.endif +.if ${MK_PF} != "no" +CHECK_UIDS+= proxy +CHECK_GIDS+= proxy authpf +.endif +installcheck: installcheck_UGID +installcheck_UGID: +.for uid in ${CHECK_UIDS} + @if ! `id -u ${uid} >/dev/null 2>&1`; then \ + echo "ERROR: Required ${uid} user is missing, see /usr/src/UPDATING."; \ + false; \ + fi +.endfor +.for gid in ${CHECK_GIDS} + @if ! `find / -prune -group ${gid} >/dev/null 2>&1`; then \ + echo "ERROR: Required ${gid} group is missing, see /usr/src/UPDATING."; \ + false; \ + fi +.endfor + +# # Required install tools to be saved in a scratch dir for safety. # .if ${MK_INFO} != "no" @@ -666,7 +692,6 @@ distributeworld installworld: installche done); \ cp $$libs $$progs ${INSTALLTMP} cp -R $${PATH_LOCALE:-"/usr/share/locale"} ${INSTALLTMP}/locale - rm -f ${METALOG} .if make(distributeworld) .for dist in ${EXTRA_DISTRIBUTIONS} -mkdir ${DESTDIR}/${DISTDIR}/${dist} @@ -728,8 +753,7 @@ redistribute: .endif distrib-dirs distribution: - cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} \ - INSTALL="install -N ${.CURDIR}/etc" ${.TARGET} + cd ${.CURDIR}/etc; ${CROSSENV} PATH=${TMPPATH} ${MAKE} ${.TARGET} # # buildkernel and installkernel @@ -1035,11 +1059,6 @@ _lex=usr.bin/lex _yacc= usr.bin/yacc .endif -.if ${BOOTSTRAPPING} < 126 -_nmtree= lib/libnetbsd \ - usr.sbin/nmtree -.endif - .if ${BOOTSTRAPPING} >= 900040 && ${BOOTSTRAPPING} < 900041 _awk= usr.bin/awk .endif @@ -1101,8 +1120,7 @@ bootstrap-tools: ${_lex} \ usr.bin/xinstall \ ${_gensnmptree} \ -usr.sbin/config \ -${_nmtree} +usr.sbin/config ${_+_}@${ECHODIR} "===> ${_tool} (obj,depend,all,install)"; \ cd ${.CURDIR}/${_tool}; \ ${MAKE} DIRPRFX=${_tool}/ obj; \ Modified: head/etc/Makefile == --- head/etc/Makefile Fri Jan 11 23:42:24 2013(r245317) +++ head/etc/Makefile Fri Jan 11 23:44:35 2013(r245318) @@ -291,27 +291,25 @@ distribution: ${DESTDIR}/etc/nsswitch.conf .endif -MTREE_CMD?=mtree - distrib-dirs: - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \ + mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ + mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var + mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr + mtree -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \ -p ${DESTDIR}/usr/include .if ${MK_BIND_LIBS} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \ + mtree -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \ -p ${DESTDIR}/usr/include .endif .if ${MK_BIND_MTREE} != "no" -
Re: svn commit: r245316 - in head: . etc
On Fri, Jan 11, 2013 at 03:40:35PM -0800, Peter Wemm wrote: > On Fri, Jan 11, 2013 at 3:19 PM, Peter Wemm wrote: > > On Fri, Jan 11, 2013 at 3:08 PM, Brooks Davis wrote: > > > >> -IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 > >> +IMAKE= ${IMAKEENV} ${MAKE} -f Makefile.inc1 \ > >> + INSTALL="install -N ${.CURDIR}/etc" \ > >> + MTREE_CMD="nmtree -N ${.CURDIR}/etc" > > > > How does this work with worlds with different UID/GID assignments? > > Eg: the freebsd.org cluster? > > > > ${.CURDIR}/etc/master.passwd does not match the installed system. > > Case in point, the freebsd.org cluster has used postfix before > sendmail gained its privilege separation. We had: > postfix:*:25:postfix > postdrop:*:26: > .. long before sendmail added: > smmsp:*:25: > mailnull:*:26: > > On an existing machine we have: > -r-xr-sr-x 1 root smmsp 719336 Jan 6 15:13 /usr/libexec/sendmail/sendmail > > But on the freebsd.org machines that have machines dating back to > 1998, this change would cause: > -r-xr-sr-x 1 root postfix 719336 Jan 6 15:13 > /usr/libexec/sendmail/sendmail > > With a silent change like that, if the admin doesn't notice.. who can > tell what would happen? Silently giving sendmail setgid access to > another subsystem's gid is.. just POLA violation at every conceivable > level and potentially dangerous. > > These tools from netbsd were meant for cross compiling.. ie: when DESTDIR != > /. I've reverted this change. In my defense I'd note that NetBSD always uses -N. If you want non-standard uids and gids there you just end your source tree. -- Brooks pgp3bu4fOhcZv.pgp Description: PGP signature