Re: svn commit: r219653 - in head/sys: arm/include i386/include
Hello! On Mon, Mar 14, 2011 at 11:30:14PM +, Jung-uk Kim wrote: Author: jkim Date: Mon Mar 14 23:30:14 2011 New Revision: 219653 URL: http://svn.freebsd.org/changeset/base/219653 Log: Make get_cyclecount(9) little bit more useful where binuptime(9) is used. get_cyclecount(9) is for random harvesting, and dropping half of it's entropy in binuptime() case may not be a good idea. It's probably better to fix manpage instead, to clarify it's intended usage. Maxim Dounin Modified: head/sys/arm/include/cpu.h head/sys/i386/include/cpu.h Modified: head/sys/arm/include/cpu.h == --- head/sys/arm/include/cpu.hMon Mar 14 23:19:04 2011 (r219652) +++ head/sys/arm/include/cpu.hMon Mar 14 23:30:14 2011 (r219653) @@ -16,7 +16,7 @@ get_cyclecount(void) struct bintime bt; binuptime(bt); - return (bt.frac ^ bt.sec); + return ((uint64_t)bt.sec 56 | bt.frac 8); } #endif Modified: head/sys/i386/include/cpu.h == --- head/sys/i386/include/cpu.h Mon Mar 14 23:19:04 2011 (r219652) +++ head/sys/i386/include/cpu.h Mon Mar 14 23:30:14 2011 (r219653) @@ -67,7 +67,7 @@ voidswi_vm(void *); * Return contents of in-cpu fast counter as a sort of bogo-time * for random-harvesting purposes. */ -static __inline u_int64_t +static __inline uint64_t get_cyclecount(void) { #if defined(I486_CPU) || defined(KLD_MODULE) @@ -75,7 +75,7 @@ get_cyclecount(void) if (!tsc_present) { binuptime(bt); - return (bt.frac ^ bt.sec); + return ((uint64_t)bt.sec 56 | bt.frac 8); } #endif return (rdtsc()); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219609 - in head/sys: amd64/linux32 i386/linux
On Sun, Mar 13, 2011 at 02:58:02PM +, Dmitry Chagin wrote: Author: dchagin Date: Sun Mar 13 14:58:02 2011 New Revision: 219609 URL: http://svn.freebsd.org/changeset/base/219609 Log: Enable shared page use for amd64/linux32 and i386/linux binaries. Move signal trampoline code from the top of the stack to the shared page. MFC after: 2 Weeks Describe the reasons for this change in more detail: Instead of installing the signal trampoline at every exec() time copy it only once when the module loads. Requested by: netchild@ Modified: head/sys/amd64/linux32/linux.h head/sys/amd64/linux32/linux32_sysvec.c head/sys/i386/linux/linux.h head/sys/i386/linux/linux_sysvec.c Modified: head/sys/amd64/linux32/linux.h == --- head/sys/amd64/linux32/linux.hSun Mar 13 13:42:43 2011 (r219608) +++ head/sys/amd64/linux32/linux.hSun Mar 13 14:58:02 2011 (r219609) @@ -47,7 +47,10 @@ extern u_char linux_debug_map[]; MALLOC_DECLARE(M_LINUX); #endif -#define LINUX32_USRSTACK((1ul 32) - PAGE_SIZE) +#define LINUX32_MAXUSER ((1ul 32) - PAGE_SIZE) +#define LINUX32_SHAREDPAGE (LINUX32_MAXUSER - PAGE_SIZE) +#define LINUX32_USRSTACKLINUX32_SHAREDPAGE + /* XXX 16 = sizeof(linux32_ps_strings) */ #define LINUX32_PS_STRINGS (LINUX32_USRSTACK - 16) #define LINUX32_MAXDSIZ (512 * 1024 * 1024) /* 512MB */ Modified: head/sys/amd64/linux32/linux32_sysvec.c == --- head/sys/amd64/linux32/linux32_sysvec.c Sun Mar 13 13:42:43 2011 (r219608) +++ head/sys/amd64/linux32/linux32_sysvec.c Sun Mar 13 14:58:02 2011 (r219609) @@ -411,8 +411,7 @@ linux_rt_sendsig(sig_t catcher, ksiginfo * Build context to run handler in. */ regs-tf_rsp = PTROUT(fp); - regs-tf_rip = LINUX32_PS_STRINGS - *(p-p_sysent-sv_szsigcode) + - linux_sznonrtsigcode; + regs-tf_rip = p-p_sysent-sv_sigcode_base + linux_sznonrtsigcode; regs-tf_rflags = ~(PSL_T | PSL_D); regs-tf_cs = _ucode32sel; regs-tf_ss = _udatasel; @@ -535,7 +534,7 @@ linux_sendsig(sig_t catcher, ksiginfo_t * Build context to run handler in. */ regs-tf_rsp = PTROUT(fp); - regs-tf_rip = LINUX32_PS_STRINGS - *(p-p_sysent-sv_szsigcode); + regs-tf_rip = p-p_sysent-sv_sigcode_base; regs-tf_rflags = ~(PSL_T | PSL_D); regs-tf_cs = _ucode32sel; regs-tf_ss = _udatasel; @@ -890,21 +889,15 @@ linux_copyout_strings(struct image_param * Also deal with signal trampoline code for this exec type. */ arginfo = (struct linux32_ps_strings *)LINUX32_PS_STRINGS; - destp = (caddr_t)arginfo - linux_szsigcode - SPARE_USRSPACE - - linux_szplatform - roundup((ARG_MAX - imgp-args-stringspace), + destp = (caddr_t)arginfo - SPARE_USRSPACE - linux_szplatform - + roundup((ARG_MAX - imgp-args-stringspace), sizeof(char *)); /* - * install sigcode - */ - copyout(imgp-proc-p_sysent-sv_sigcode, - ((caddr_t)arginfo - linux_szsigcode), linux_szsigcode); - - /* * Install LINUX_PLATFORM */ - copyout(linux_platform, ((caddr_t)arginfo - linux_szsigcode - - linux_szplatform), linux_szplatform); + copyout(linux_platform, ((caddr_t)arginfo - linux_szplatform), + linux_szplatform); /* * If we have a valid auxargs ptr, prepare some room @@ -1050,7 +1043,7 @@ struct sysentvec elf_linux_sysvec = { .sv_minsigstksz = LINUX_MINSIGSTKSZ, .sv_pagesize= PAGE_SIZE, .sv_minuser = VM_MIN_ADDRESS, - .sv_maxuser = LINUX32_USRSTACK, + .sv_maxuser = LINUX32_MAXUSER, .sv_usrstack= LINUX32_USRSTACK, .sv_psstrings = LINUX32_PS_STRINGS, .sv_stackprot = VM_PROT_ALL, @@ -1058,12 +1051,15 @@ struct sysentvec elf_linux_sysvec = { .sv_setregs = exec_linux_setregs, .sv_fixlimit= linux32_fixlimit, .sv_maxssiz = linux32_maxssiz, - .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32, + .sv_flags = SV_ABI_LINUX | SV_ILP32 | SV_IA32 | SV_SHP, .sv_set_syscall_retval = cpu_set_syscall_retval, .sv_fetch_syscall_args = linux32_fetch_syscall_args, .sv_syscallnames = NULL, + .sv_shared_page_base = LINUX32_SHAREDPAGE, + .sv_shared_page_len = PAGE_SIZE, .sv_schedtail = linux_schedtail, }; +INIT_SYSENTVEC(elf_sysvec, elf_linux_sysvec); static char GNU_ABI_VENDOR[] = GNU; static int GNULINUX_ABI_DESC = 0; Modified: head/sys/i386/linux/linux.h == --- head/sys/i386/linux/linux.h Sun Mar 13 13:42:43 2011
svn commit: r219660 - in stable/8: share/man/man4 sys/netgraph
Author: ae Date: Tue Mar 15 07:15:04 2011 New Revision: 219660 URL: http://svn.freebsd.org/changeset/base/219660 Log: MFC r219127: Add XMIT_FAILOVER transmit algorithm to ng_one2many node. Packets are delivered out the first active many hook. PR: kern/137775 Submitted by: Maxim Ignatenko Modified: stable/8/share/man/man4/ng_one2many.4 stable/8/sys/netgraph/ng_one2many.c stable/8/sys/netgraph/ng_one2many.h Directory Properties: stable/8/share/man/man4/ (props changed) stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/share/man/man4/ng_one2many.4 == --- stable/8/share/man/man4/ng_one2many.4 Tue Mar 15 06:53:33 2011 (r219659) +++ stable/8/share/man/man4/ng_one2many.4 Tue Mar 15 07:15:04 2011 (r219660) @@ -34,7 +34,7 @@ .\ .\ $FreeBSD$ .\ -.Dd February 19, 2006 +.Dd March 1, 2011 .Dt NG_ONE2MANY 4 .Os .Sh NAME @@ -96,6 +96,10 @@ hooks. Each packet goes out each .Dv many hook. +.It Dv NG_ONE2MANY_XMIT_FAILOVER +Packets are delivered out the first active +.Dv many +hook. .El .Pp In the future other algorithms may be added as well. Modified: stable/8/sys/netgraph/ng_one2many.c == --- stable/8/sys/netgraph/ng_one2many.c Tue Mar 15 06:53:33 2011 (r219659) +++ stable/8/sys/netgraph/ng_one2many.c Tue Mar 15 07:15:04 2011 (r219660) @@ -278,6 +278,7 @@ ng_one2many_rcvmsg(node_p node, item_p i switch (conf-xmitAlg) { case NG_ONE2MANY_XMIT_ROUNDROBIN: case NG_ONE2MANY_XMIT_ALL: + case NG_ONE2MANY_XMIT_FAILOVER: break; default: error = EINVAL; @@ -473,6 +474,9 @@ ng_one2many_rcvdata(hook_p hook, item_p NG_SEND_DATA_ONLY(error, mdst-hook, m2); } break; + case NG_ONE2MANY_XMIT_FAILOVER: + dst = priv-many[priv-activeMany[0]]; + break; #ifdef INVARIANTS default: panic(%s: invalid xmitAlg, __func__); @@ -583,6 +587,7 @@ ng_one2many_update_many(priv_p priv) priv-nextMany %= priv-numActiveMany; break; case NG_ONE2MANY_XMIT_ALL: + case NG_ONE2MANY_XMIT_FAILOVER: break; #ifdef INVARIANTS default: Modified: stable/8/sys/netgraph/ng_one2many.h == --- stable/8/sys/netgraph/ng_one2many.h Tue Mar 15 06:53:33 2011 (r219659) +++ stable/8/sys/netgraph/ng_one2many.h Tue Mar 15 07:15:04 2011 (r219660) @@ -61,6 +61,7 @@ /* Algorithms for outgoing packet distribution (XXX only one so far) */ #define NG_ONE2MANY_XMIT_ROUNDROBIN1 /* round-robin delivery */ #define NG_ONE2MANY_XMIT_ALL 2 /* send packets to all many hooks */ +#defineNG_ONE2MANY_XMIT_FAILOVER 3 /* send packets to first active many */ /* Algorithms for detecting link failure (XXX only one so far) */ #define NG_ONE2MANY_FAIL_MANUAL1 /* use enabledLinks[] array */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219661 - in stable/7: share/man/man4 sys/netgraph
Author: ae Date: Tue Mar 15 07:15:46 2011 New Revision: 219661 URL: http://svn.freebsd.org/changeset/base/219661 Log: MFC r219127: Add XMIT_FAILOVER transmit algorithm to ng_one2many node. Packets are delivered out the first active many hook. PR: kern/137775 Submitted by: Maxim Ignatenko Modified: stable/7/share/man/man4/ng_one2many.4 stable/7/sys/netgraph/ng_one2many.c stable/7/sys/netgraph/ng_one2many.h Directory Properties: stable/7/share/man/man4/ (props changed) stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/share/man/man4/ng_one2many.4 == --- stable/7/share/man/man4/ng_one2many.4 Tue Mar 15 07:15:04 2011 (r219660) +++ stable/7/share/man/man4/ng_one2many.4 Tue Mar 15 07:15:46 2011 (r219661) @@ -34,7 +34,7 @@ .\ .\ $FreeBSD$ .\ -.Dd February 19, 2006 +.Dd March 1, 2011 .Dt NG_ONE2MANY 4 .Os .Sh NAME @@ -96,6 +96,10 @@ hooks. Each packet goes out each .Dv many hook. +.It Dv NG_ONE2MANY_XMIT_FAILOVER +Packets are delivered out the first active +.Dv many +hook. .El .Pp In the future other algorithms may be added as well. Modified: stable/7/sys/netgraph/ng_one2many.c == --- stable/7/sys/netgraph/ng_one2many.c Tue Mar 15 07:15:04 2011 (r219660) +++ stable/7/sys/netgraph/ng_one2many.c Tue Mar 15 07:15:46 2011 (r219661) @@ -278,6 +278,7 @@ ng_one2many_rcvmsg(node_p node, item_p i switch (conf-xmitAlg) { case NG_ONE2MANY_XMIT_ROUNDROBIN: case NG_ONE2MANY_XMIT_ALL: + case NG_ONE2MANY_XMIT_FAILOVER: break; default: error = EINVAL; @@ -473,6 +474,9 @@ ng_one2many_rcvdata(hook_p hook, item_p NG_SEND_DATA_ONLY(error, mdst-hook, m2); } break; + case NG_ONE2MANY_XMIT_FAILOVER: + dst = priv-many[priv-activeMany[0]]; + break; #ifdef INVARIANTS default: panic(%s: invalid xmitAlg, __func__); @@ -583,6 +587,7 @@ ng_one2many_update_many(priv_p priv) priv-nextMany %= priv-numActiveMany; break; case NG_ONE2MANY_XMIT_ALL: + case NG_ONE2MANY_XMIT_FAILOVER: break; #ifdef INVARIANTS default: Modified: stable/7/sys/netgraph/ng_one2many.h == --- stable/7/sys/netgraph/ng_one2many.h Tue Mar 15 07:15:04 2011 (r219660) +++ stable/7/sys/netgraph/ng_one2many.h Tue Mar 15 07:15:46 2011 (r219661) @@ -61,6 +61,7 @@ /* Algorithms for outgoing packet distribution (XXX only one so far) */ #define NG_ONE2MANY_XMIT_ROUNDROBIN1 /* round-robin delivery */ #define NG_ONE2MANY_XMIT_ALL 2 /* send packets to all many hooks */ +#defineNG_ONE2MANY_XMIT_FAILOVER 3 /* send packets to first active many */ /* Algorithms for detecting link failure (XXX only one so far) */ #define NG_ONE2MANY_FAIL_MANUAL1 /* use enabledLinks[] array */ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219662 - in stable/8/sys: amd64/amd64 arm/at91 arm/mv arm/sa11x0 arm/xscale/i80321 arm/xscale/i8134x arm/xscale/ixp425 arm/xscale/pxa boot/common boot/forth i386/i386 i386/xen ia64/ia6...
Author: pluknet Date: Tue Mar 15 08:20:59 2011 New Revision: 219662 URL: http://svn.freebsd.org/changeset/base/219662 Log: MFC kern.msgbufsize: r217688-217689,r217709,r218666-218667,r218913. Note, that arm/{s3c2xx0,econa} exist only in head, thus not merged. r217688: Make MSGBUF_SIZE kernel option a loader tunable kern.msgbufsize. r217689: Add kern.msgbufsize default setting to /boot/defaults/loader.conf. r217709,218666-218667,218913 by marcel, cognet: Fix up for various arm subtargets: call init_param1() before we use msgbufsize, now that the size of the message buffer is a tunable. Reviewed by: marcel Approved by: avg (mentor) Modified: stable/8/sys/amd64/amd64/machdep.c stable/8/sys/arm/at91/at91_machdep.c stable/8/sys/arm/mv/mv_machdep.c stable/8/sys/arm/sa11x0/assabet_machdep.c stable/8/sys/arm/xscale/i80321/ep80219_machdep.c stable/8/sys/arm/xscale/i80321/iq31244_machdep.c stable/8/sys/arm/xscale/i8134x/crb_machdep.c stable/8/sys/arm/xscale/ixp425/avila_machdep.c stable/8/sys/arm/xscale/pxa/pxa_machdep.c stable/8/sys/boot/common/loader.8 stable/8/sys/boot/forth/loader.conf stable/8/sys/i386/i386/machdep.c stable/8/sys/i386/i386/pmap.c stable/8/sys/i386/xen/pmap.c stable/8/sys/ia64/ia64/machdep.c stable/8/sys/kern/subr_param.c stable/8/sys/mips/mips/machdep.c stable/8/sys/mips/mips/pmap.c stable/8/sys/pc98/pc98/machdep.c stable/8/sys/powerpc/aim/machdep.c stable/8/sys/powerpc/aim/mmu_oea.c stable/8/sys/powerpc/aim/mmu_oea64.c stable/8/sys/powerpc/booke/machdep.c stable/8/sys/powerpc/booke/pmap.c stable/8/sys/sparc64/sparc64/machdep.c stable/8/sys/sparc64/sparc64/pmap.c stable/8/sys/sun4v/sun4v/machdep.c stable/8/sys/sun4v/sun4v/pmap.c stable/8/sys/sys/msgbuf.h stable/8/sys/vm/vm_page.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/amd64/amd64/machdep.c == --- stable/8/sys/amd64/amd64/machdep.c Tue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/amd64/amd64/machdep.c Tue Mar 15 08:20:59 2011 (r219662) @@ -51,7 +51,6 @@ __FBSDID($FreeBSD$); #include opt_isa.h #include opt_kstack_pages.h #include opt_maxmem.h -#include opt_msgbuf.h #include opt_perfmon.h #include opt_sched.h #include opt_kdtrace.h @@ -1511,7 +1510,7 @@ do_next: * calculation, etc.). */ while (phys_avail[pa_indx - 1] + PAGE_SIZE + - round_page(MSGBUF_SIZE) = phys_avail[pa_indx]) { + round_page(msgbufsize) = phys_avail[pa_indx]) { physmem -= atop(phys_avail[pa_indx] - phys_avail[pa_indx - 1]); phys_avail[pa_indx--] = 0; phys_avail[pa_indx--] = 0; @@ -1520,7 +1519,7 @@ do_next: Maxmem = atop(phys_avail[pa_indx]); /* Trim off space for the message buffer. */ - phys_avail[pa_indx] -= round_page(MSGBUF_SIZE); + phys_avail[pa_indx] -= round_page(msgbufsize); /* Map the message buffer. */ msgbufp = (struct msgbuf *)PHYS_TO_DMAP(phys_avail[pa_indx]); @@ -1721,7 +1720,7 @@ hammer_time(u_int64_t modulep, u_int64_t /* now running on new page tables, configured,and u/iom is accessible */ - msgbufinit(msgbufp, MSGBUF_SIZE); + msgbufinit(msgbufp, msgbufsize); fpuinit(); /* transfer to user mode */ Modified: stable/8/sys/arm/at91/at91_machdep.c == --- stable/8/sys/arm/at91/at91_machdep.cTue Mar 15 07:15:46 2011 (r219661) +++ stable/8/sys/arm/at91/at91_machdep.cTue Mar 15 08:20:59 2011 (r219662) @@ -43,8 +43,6 @@ * Created : 17/09/94 */ -#include opt_msgbuf.h - #include sys/cdefs.h __FBSDID($FreeBSD$); @@ -230,6 +228,9 @@ initarm(void *arg, void *arg2) pcpu_init(pcpup, 0, sizeof(struct pcpu)); PCPU_SET(curthread, thread0); + /* Do basic tuning, hz etc */ + init_param1(); + freemempos = (lastaddr + PAGE_MASK) ~PAGE_MASK; /* Define a macro to simplify memory allocation */ #define valloc_pages(var, np) \ @@ -274,7 +275,7 @@ initarm(void *arg, void *arg2) valloc_pages(abtstack, ABT_STACK_SIZE); valloc_pages(undstack, UND_STACK_SIZE); valloc_pages(kernelstack, KSTACK_PAGES); - valloc_pages(msgbufpv, round_page(MSGBUF_SIZE) / PAGE_SIZE); + valloc_pages(msgbufpv, round_page(msgbufsize) / PAGE_SIZE); /* * Now we start construction of the L1 page table @@ -319,7 +320,7 @@ initarm(void *arg, void *arg2) pmap_map_chunk(l1pagetable, kernel_l1pt.pv_va, kernel_l1pt.pv_pa, L1_TABLE_SIZE,
svn commit: r219663 - head/etc/pam.d
Author: des Date: Tue Mar 15 10:13:35 2011 New Revision: 219663 URL: http://svn.freebsd.org/changeset/base/219663 Log: Forgot to commit this change along with r219563: pam_group(8) now issues a warning if neither luser nor ruser is specified. The correct option for su(1) is ruser. MFC after:1 month Modified: head/etc/pam.d/su Modified: head/etc/pam.d/su == --- head/etc/pam.d/su Tue Mar 15 08:20:59 2011(r219662) +++ head/etc/pam.d/su Tue Mar 15 10:13:35 2011(r219663) @@ -7,7 +7,7 @@ # auth auth sufficient pam_rootok.so no_warn auth sufficient pam_self.so no_warn -auth requisite pam_group.sono_warn group=wheel root_only fail_safe +auth requisite pam_group.sono_warn group=wheel root_only fail_safe ruser auth include system # account ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219664 - stable/8/sys/kern
Author: kib Date: Tue Mar 15 10:17:18 2011 New Revision: 219664 URL: http://svn.freebsd.org/changeset/base/219664 Log: MFC r219396: Do not assert buffer lock in VFS_STRATEGY() when kernel already paniced. Sponsored by: The FreeBSD Foundation Modified: stable/8/sys/kern/vfs_subr.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/vfs_subr.c == --- stable/8/sys/kern/vfs_subr.cTue Mar 15 10:13:35 2011 (r219663) +++ stable/8/sys/kern/vfs_subr.cTue Mar 15 10:17:18 2011 (r219664) @@ -3863,7 +3863,7 @@ vop_strategy_pre(void *ap) if ((bp-b_flags B_CLUSTER) != 0) return; - if (!BUF_ISLOCKED(bp)) { + if (panicstr == NULL !BUF_ISLOCKED(bp)) { if (vfs_badlock_print) printf( VOP_STRATEGY: bp is not locked but should be\n); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219666 - stable/8/sys/compat/linux
Author: netchild Date: Tue Mar 15 13:19:26 2011 New Revision: 219666 URL: http://svn.freebsd.org/changeset/base/219666 Log: MFC r218497: Linux' shm_open() fails because it wants to find some funky shmfs to construct the full pathname. It starts to search at the default mountpoint which is /dev/shm. If this fails it runs through fstab and searches for shmfs and tmpfs. Whatever it finds will be statfs()'ed to be checked for Linux' fs magic for shmfs (0x01021994). Ideally our tmpfs should deliver this fs magic to Linux processes, but as our tmpfs is considered to be an experimental feature we can not assume that there is always a tmpfs available. To make shared memory work in the Linuxulator, force the fs type of /dev/shm (which can be a symlink) to match what Linux expects. The user is responsible (info has to be added to the linux base ports and the docs) to setup a suitable link for /dev/shm. Noticed by:Andre Albsmeier andre.albsme...@siemens.com Submitted by: Andre Albsmeier andre.albsme...@siemens.com Modified: stable/8/sys/compat/linux/linux_stats.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/compat/linux/linux_stats.c == --- stable/8/sys/compat/linux/linux_stats.c Tue Mar 15 12:24:40 2011 (r219665) +++ stable/8/sys/compat/linux/linux_stats.c Tue Mar 15 13:19:26 2011 (r219666) @@ -60,6 +60,8 @@ __FBSDID($FreeBSD$); #include security/mac/mac_framework.h +#defineLINUX_SHMFS_MAGIC 0x01021994 + static void translate_vnhook_major_minor(struct vnode *vp, struct stat *sb) { @@ -390,7 +392,7 @@ linux_statfs(struct thread *td, struct l struct l_statfs linux_statfs; struct statfs bsd_statfs; char *path; - int error; + int error, dev_shm; LCONVPATHEXIST(td, args-path, path); @@ -398,11 +400,17 @@ linux_statfs(struct thread *td, struct l if (ldebug(statfs)) printf(ARGS(statfs, %s, *), path); #endif + dev_shm = 0; error = kern_statfs(td, path, UIO_SYSSPACE, bsd_statfs); + if (strncmp(path, /dev/shm, sizeof(/dev/shm) - 1) == 0) + dev_shm = (path[8] == '\0' + || (path[8] == '/' path[9] == '\0')); LFREEPATH(path); if (error) return (error); bsd_to_linux_statfs(bsd_statfs, linux_statfs); + if (dev_shm) + linux_statfs.f_type = LINUX_SHMFS_MAGIC; return copyout(linux_statfs, args-buf, sizeof(linux_statfs)); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
Author: nwhitehorn Date: Tue Mar 15 13:27:34 2011 New Revision: 219667 URL: http://svn.freebsd.org/changeset/base/219667 Log: Turn on softupdates by default. We need a UI to set filesystem parameters. Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c == --- head/usr.sbin/bsdinstall/partedit/gpart_ops.c Tue Mar 15 13:19:26 2011(r219666) +++ head/usr.sbin/bsdinstall/partedit/gpart_ops.c Tue Mar 15 13:27:34 2011(r219667) @@ -496,7 +496,7 @@ set_default_part_metadata(const char *na if (strcmp(type, freebsd-ufs) == 0) { md-newfs = malloc(255); - sprintf(md-newfs, newfs /dev/%s, name); + sprintf(md-newfs, newfs -U /dev/%s, name); } } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219668 - head/sys/compat/linux
Author: netchild Date: Tue Mar 15 13:40:47 2011 New Revision: 219668 URL: http://svn.freebsd.org/changeset/base/219668 Log: Staticize functions which are not used somewhere else, move the corresponding prototypes from the header to the code file. Modified: head/sys/compat/linux/linux_mib.c head/sys/compat/linux/linux_mib.h Modified: head/sys/compat/linux/linux_mib.c == --- head/sys/compat/linux/linux_mib.c Tue Mar 15 13:27:34 2011 (r219667) +++ head/sys/compat/linux/linux_mib.c Tue Mar 15 13:40:47 2011 (r219668) @@ -69,6 +69,10 @@ static unsigned linux_osd_jail_slot; SYSCTL_NODE(_compat, OID_AUTO, linux, CTLFLAG_RW, 0, Linux mode); +static int linux_set_osname(struct thread *td, char *osname); +static int linux_set_osrelease(struct thread *td, char *osrelease); +static int linux_set_oss_version(struct thread *td, int oss_version); + static int linux_sysctl_osname(SYSCTL_HANDLER_ARGS) { @@ -469,7 +473,7 @@ linux_get_osname(struct thread *td, char mtx_unlock(pr-pr_mtx); } -int +static int linux_set_osname(struct thread *td, char *osname) { struct prison *pr; @@ -505,7 +509,7 @@ linux_kernver(struct thread *td) return (osrel); } -int +static int linux_set_osrelease(struct thread *td, char *osrelease) { struct prison *pr; @@ -533,7 +537,7 @@ linux_get_oss_version(struct thread *td) return (version); } -int +static int linux_set_oss_version(struct thread *td, int oss_version) { struct prison *pr; Modified: head/sys/compat/linux/linux_mib.h == --- head/sys/compat/linux/linux_mib.h Tue Mar 15 13:27:34 2011 (r219667) +++ head/sys/compat/linux/linux_mib.h Tue Mar 15 13:40:47 2011 (r219668) @@ -35,13 +35,10 @@ voidlinux_osd_jail_register(void); void linux_osd_jail_deregister(void); void linux_get_osname(struct thread *td, char *dst); -intlinux_set_osname(struct thread *td, char *osname); void linux_get_osrelease(struct thread *td, char *dst); -intlinux_set_osrelease(struct thread *td, char *osrelease); intlinux_get_oss_version(struct thread *td); -intlinux_set_oss_version(struct thread *td, int oss_version); intlinux_kernver(struct thread *td); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219669 - head/sbin/hastd
Author: pjd Date: Tue Mar 15 13:53:39 2011 New Revision: 219669 URL: http://svn.freebsd.org/changeset/base/219669 Log: Remove #include needed for debugging. MFC after:1 week Modified: head/sbin/hastd/proto_common.c Modified: head/sbin/hastd/proto_common.c == --- head/sbin/hastd/proto_common.c Tue Mar 15 13:40:47 2011 (r219668) +++ head/sbin/hastd/proto_common.c Tue Mar 15 13:53:39 2011 (r219669) @@ -104,7 +104,6 @@ proto_common_send(int sock, const unsign return (proto_descriptor_send(sock, fd)); } -#include stdio.h static int proto_descriptor_recv(int sock, int *fdp) { ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219653 - in head/sys: arm/include i386/include
On Tuesday 15 March 2011 02:19 am, Maxim Dounin wrote: Hello! On Mon, Mar 14, 2011 at 11:30:14PM +, Jung-uk Kim wrote: Author: jkim Date: Mon Mar 14 23:30:14 2011 New Revision: 219653 URL: http://svn.freebsd.org/changeset/base/219653 Log: Make get_cyclecount(9) little bit more useful where binuptime(9) is used. get_cyclecount(9) is for random harvesting, and dropping half of it's entropy in binuptime() case may not be a good idea. I know it is used for random harvesting but we are not dropping much entropy here (if any). Because it is mostly used boot time, bt.sec is often times trivial. In other words, it only affects few lower bits (trivially) and other bits are just flipped. Basically, I am trying to preserve as much entropy as possible without losing historical get_cyclecount() semantics. It's probably better to fix manpage instead, to clarify it's intended usage. It had to be done long ago. :-( Jung-uk Kim Maxim Dounin Modified: head/sys/arm/include/cpu.h head/sys/i386/include/cpu.h Modified: head/sys/arm/include/cpu.h = = --- head/sys/arm/include/cpu.h Mon Mar 14 23:19:04 2011(r219652) +++ head/sys/arm/include/cpu.hMon Mar 14 23:30:14 2011(r219653) @@ -16,7 +16,7 @@ get_cyclecount(void) struct bintime bt; binuptime(bt); - return (bt.frac ^ bt.sec); + return ((uint64_t)bt.sec 56 | bt.frac 8); } #endif Modified: head/sys/i386/include/cpu.h = = --- head/sys/i386/include/cpu.hMon Mar 14 23:19:04 2011(r219652) +++ head/sys/i386/include/cpu.h Mon Mar 14 23:30:14 2011 (r219653) @@ -67,7 +67,7 @@ voidswi_vm(void *); * Return contents of in-cpu fast counter as a sort of bogo-time * for random-harvesting purposes. */ -static __inline u_int64_t +static __inline uint64_t get_cyclecount(void) { #if defined(I486_CPU) || defined(KLD_MODULE) @@ -75,7 +75,7 @@ get_cyclecount(void) if (!tsc_present) { binuptime(bt); - return (bt.frac ^ bt.sec); + return ((uint64_t)bt.sec 56 | bt.frac 8); } #endif return (rdtsc()); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219646 - head/sys/x86/isa
On Monday 14 March 2011 10:31 pm, Bruce Evans wrote: On Mon, 14 Mar 2011, Jung-uk Kim wrote: Log: When TSC is unavailable, broken or disabled and the current timecounter has better quality than i8254 timer, use it for DELAY(9). You cannot use a random timecounter for DELAY(). DELAY() is carefully written to not use any locks, so that it doesn't deadlock when called in the any context from a bad console driver like syscons when syscons is called from ddb. (Bad console drivers may have their own locks which deadlock in ddb, but that is another problem.) Even the i8254 timer, which is the only timer that should be used by DELAY(), normally use locks that used to cause deadlock, but DELAY() was unbroken to bypass the locks when it is called from ddb. I disagree. I think we should keep away from i8254 as much as possible. Actually, i8254 is the only timer that requires locking in the first place because of its braindead design. All other x86 timers do not require any locking at all. We even sacrificed upper 32 bits of HPET in favor of i386. :-( Cpufreq and other calibration code should use a normal timecounter via nanouptime() in all cases and never go near low level timecounters or DELAY(). There are (hopefully minor) problems getting the nanotime() initialized before it used. The dummy timecounter is just what you don't want to use. That's exactly the problem. Even in this patch, it isn't clear that the low level timecounters are initialized before they are used. The timecounter is always initialized first, then set. Modified: head/sys/x86/isa/clock.c = = --- head/sys/x86/isa/clock.c Mon Mar 14 19:31:43 2011(r219645) +++ head/sys/x86/isa/clock.c Mon Mar 14 22:05:59 2011(r219646) @@ -245,6 +245,42 @@ getit(void) return ((high 8) | low); } +static __inline void +delay_tsc(int n) +{ + uint64_t start, end, now; + + sched_pin(); + start = rdtsc(); + end = start + (tsc_freq * n) / 100; + do { + cpu_spinwait(); + now = rdtsc(); + } while (now end || (now start end start)); + sched_unpin(); +} You cannot call random scheduling code from DELAY(), since the scheduling code is not designed to be called in the any context. As it happens, sched_pin() and sched_unpin() are safe, and were already used in the TSC case. Actually, I really like to get rid of this code. It isn't safe for many reasons, e.g., its frequency may change while in the loop and end result is unpredictable if TSC is not invariant. We may limit its use for invariant case, though. + +static __inline void +delay_timecounter(struct timecounter *tc, int n) +{ + uint64_t end, now; + u_int last, mask, u; + + mask = tc-tc_counter_mask; + last = tc-tc_get_timecount(tc) mask; + end = tc-tc_frequency * n / 100; This depends on the delicate timecounter locking to be safe. I think it it is safe except possibly in tc_get_timecount(), for the same reasons that nanouptime() can run safely with no visible locking. tc must be the current timecounter/timehands, which is guaranteed to not be in an in-between state or become so while we are using it, despite there being no visible locking. Actually there are some minor races: - in nanouptime(), the timecounter generation is checked to avoid using a new generation if necessary, but updates of the generation count and the fileds that it protects are not properly atomic. - here, the check of the generation is missing. So this works without races when called from ddb (since ddb stops other CPUs), but has minor races in general. Window of the races is very narrow here and it only happens on i386 where reading uint64_t is not atomic if my understanding is correct. It cannot be any worse than tsc_freq anyway. ;-) + now = 0; + do { + cpu_spinwait(); + u = tc-tc_get_timecount(tc) mask; + if (u last) + now += mask - last + u + 1; + else + now += u - last; + last = u; + } while (now end); +} + /* * Wait n microseconds. * Relies on timer 1 counting down from (i8254_freq / hz) @@ -253,6 +289,7 @@ getit(void) void DELAY(int n) { + struct timecounter *tc; int delta, prev_tick, tick, ticks_left; #ifdef DELAYDEBUG @@ -262,16 +299,12 @@ DELAY(int n) #endif if (tsc_freq != 0) { - uint64_t start, end, now; - - sched_pin(); - start = rdtsc(); - end = start + (tsc_freq * n) / 100; - do { - cpu_spinwait(); - now = rdtsc(); - } while (now end || (now start end start)); - sched_unpin(); + delay_tsc(n); + return; + } + tc =
Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
On Tue, 2011-03-15 at 13:27 +, Nathan Whitehorn wrote: Author: nwhitehorn Date: Tue Mar 15 13:27:34 2011 New Revision: 219667 URL: http://svn.freebsd.org/changeset/base/219667 Log: Turn on softupdates by default. We need a UI to set filesystem parameters. Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c This would appear to still be a change from the previous behaviour, where softupdates were enabled by default for any filesystem except for the root filesystem. I wonder if it is time to start enabling SU+J on non-root filesystems now? Gavin -- Gavin Atkinson FreeBSD committer and bugmeister GPG: A093262B (313A A79F 697D 3A5C 216A EDF5 935D EF44 A093 262B) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219672 - in head: share/man/man9 sys/i386/include
Author: jkim Date: Tue Mar 15 17:14:26 2011 New Revision: 219672 URL: http://svn.freebsd.org/changeset/base/219672 Log: Unconditionally use binuptime(9) for get_cyclecount(9) on i386. Since this function is almost exclusively used for random harvesting, there is no need for micro-optimization. Adjust the manual page accordingly. Modified: head/share/man/man9/get_cyclecount.9 head/sys/i386/include/cpu.h Modified: head/share/man/man9/get_cyclecount.9 == --- head/share/man/man9/get_cyclecount.9Tue Mar 15 16:50:17 2011 (r219671) +++ head/share/man/man9/get_cyclecount.9Tue Mar 15 17:14:26 2011 (r219672) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd October 24, 2009 +.Dd March 15, 2011 .Dt GET_CYCLECOUNT 9 .Os .Sh NAME @@ -65,14 +65,14 @@ do not have such a register, so .Fn get_cyclecount on these platforms -returns a (non-monotonic) combination of numbers +returns a (monotonic) combination of numbers represented by the structure returned by .Xr binuptime 9 . .Pp The -.Tn Pentium -processors all use the +.Tn AMD64 and Intel 64 +processors use the .Li TSC register. .Pp Modified: head/sys/i386/include/cpu.h == --- head/sys/i386/include/cpu.h Tue Mar 15 16:50:17 2011(r219671) +++ head/sys/i386/include/cpu.h Tue Mar 15 17:14:26 2011(r219672) @@ -70,15 +70,10 @@ voidswi_vm(void *); static __inline uint64_t get_cyclecount(void) { -#if defined(I486_CPU) || defined(KLD_MODULE) struct bintime bt; - if (!tsc_present) { - binuptime(bt); - return ((uint64_t)bt.sec 56 | bt.frac 8); - } -#endif - return (rdtsc()); + binuptime(bt); + return ((uint64_t)bt.sec 56 | bt.frac 8); } #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219673 - in head/sys: amd64/include contrib/altq/altq i386/i386 pc98/pc98 x86/x86
Author: jkim Date: Tue Mar 15 17:19:52 2011 New Revision: 219673 URL: http://svn.freebsd.org/changeset/base/219673 Log: Deprecate tsc_present as the last of its real consumers finally disappeared. Modified: head/sys/amd64/include/cpu.h head/sys/contrib/altq/altq/altq_subr.c head/sys/i386/i386/machdep.c head/sys/pc98/pc98/machdep.c head/sys/x86/x86/tsc.c Modified: head/sys/amd64/include/cpu.h == --- head/sys/amd64/include/cpu.hTue Mar 15 17:14:26 2011 (r219672) +++ head/sys/amd64/include/cpu.hTue Mar 15 17:19:52 2011 (r219673) @@ -56,7 +56,6 @@ #ifdef _KERNEL extern charbtext[]; extern charetext[]; -extern int tsc_present; void cpu_halt(void); void cpu_reset(void); Modified: head/sys/contrib/altq/altq/altq_subr.c == --- head/sys/contrib/altq/altq/altq_subr.c Tue Mar 15 17:14:26 2011 (r219672) +++ head/sys/contrib/altq/altq/altq_subr.c Tue Mar 15 17:19:52 2011 (r219673) @@ -78,10 +78,12 @@ #include machine/clock.h #endif #if defined(__amd64__) || defined(__i386__) -#include machine/cpu.h /* for cpu_feature or tsc_present */ #include machine/cpufunc.h /* for pentium tsc */ -#if defined(__NetBSD__) || defined(__OpenBSD__) #include machine/specialreg.h/* for CPUID_TSC */ +#ifdef __FreeBSD__ +#include machine/md_var.h/* for cpu_feature */ +#elif defined(__NetBSD__) || defined(__OpenBSD__) +#include machine/cpu.h /* for cpu_feature */ #endif #endif /* __amd64 || __i386__ */ @@ -927,7 +929,7 @@ init_machclk_setup(void) #if defined(__amd64__) || defined(__i386__) /* check if TSC is available */ #ifdef __FreeBSD__ - if (!tsc_present || tsc_freq == 0) + if ((cpu_feature CPUID_TSC) == 0 || tsc_freq == 0) #else if ((cpu_feature CPUID_TSC) == 0) #endif Modified: head/sys/i386/i386/machdep.c == --- head/sys/i386/i386/machdep.cTue Mar 15 17:14:26 2011 (r219672) +++ head/sys/i386/i386/machdep.cTue Mar 15 17:19:52 2011 (r219673) @@ -1141,7 +1141,7 @@ cpu_est_clockrate(int cpu_id, uint64_t * if (pcpu_find(cpu_id) == NULL || rate == NULL) return (EINVAL); - if (!tsc_present) + if ((cpu_feature CPUID_TSC) == 0) return (EOPNOTSUPP); /* If TSC is P-state invariant, DELAY(9) based logic fails. */ Modified: head/sys/pc98/pc98/machdep.c == --- head/sys/pc98/pc98/machdep.cTue Mar 15 17:14:26 2011 (r219672) +++ head/sys/pc98/pc98/machdep.cTue Mar 15 17:19:52 2011 (r219673) @@ -1076,7 +1076,7 @@ cpu_est_clockrate(int cpu_id, uint64_t * if (pcpu_find(cpu_id) == NULL || rate == NULL) return (EINVAL); - if (!tsc_present) + if ((cpu_feature CPUID_TSC) == 0) return (EOPNOTSUPP); /* If we're booting, trust the rate calibrated moments ago. */ Modified: head/sys/x86/x86/tsc.c == --- head/sys/x86/x86/tsc.c Tue Mar 15 17:14:26 2011(r219672) +++ head/sys/x86/x86/tsc.c Tue Mar 15 17:19:52 2011(r219673) @@ -49,7 +49,6 @@ __FBSDID($FreeBSD$); uint64_t tsc_freq; inttsc_is_invariant; -inttsc_present; static eventhandler_tag tsc_levels_tag, tsc_pre_tag, tsc_post_tag; SYSCTL_INT(_kern_timecounter, OID_AUTO, invariant_tsc, CTLFLAG_RDTUN, @@ -89,11 +88,7 @@ init_TSC(void) { u_int64_t tscval[2]; - if ((cpu_feature CPUID_TSC) == 0) - return; - tsc_present = 1; - - if (tsc_disabled) + if ((cpu_feature CPUID_TSC) == 0 || tsc_disabled) return; if (bootverbose) @@ -155,7 +150,7 @@ void init_TSC_tc(void) { - if (!tsc_present || tsc_disabled) + if ((cpu_feature CPUID_TSC) == 0 || tsc_disabled) return; /* ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
On 03/15/11 09:19, Gavin Atkinson wrote: On Tue, 2011-03-15 at 13:27 +, Nathan Whitehorn wrote: Author: nwhitehorn Date: Tue Mar 15 13:27:34 2011 New Revision: 219667 URL: http://svn.freebsd.org/changeset/base/219667 Log: Turn on softupdates by default. We need a UI to set filesystem parameters. Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c This would appear to still be a change from the previous behaviour, where softupdates were enabled by default for any filesystem except for the root filesystem. It is -- and this needs to become settable. Bear in mind, however, that the default partition layout is also different. If you select the auto option, only one file system is made, so there are no non-root file systems. I wonder if it is time to start enabling SU+J on non-root filesystems now? That's certainly something to think about, although I'll defer whether that is wise to others. It's a little bit of a pain on the implementation side, since you can't turn it on from newfs, but that isn't a serious obstacle. -Natha ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
On Tue, Mar 15, 2011 at 1:26 PM, Nathan Whitehorn nwhiteh...@freebsd.org wrote: On 03/15/11 09:19, Gavin Atkinson wrote: I wonder if it is time to start enabling SU+J on non-root filesystems now? That's certainly something to think about, although I'll defer whether that is wise to others. It's a little bit of a pain on the implementation side, since you can't turn it on from newfs, but that isn't a serious obstacle. I suspect the consensus of people like -arch and -fs will be that the burn-in time before it is considered sufficiently stable is be measured in years. -Ben Kaduk ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219667 - head/usr.sbin/bsdinstall/partedit
On Tue, 2011-03-15 at 12:26 -0500, Nathan Whitehorn wrote: On 03/15/11 09:19, Gavin Atkinson wrote: On Tue, 2011-03-15 at 13:27 +, Nathan Whitehorn wrote: Author: nwhitehorn Date: Tue Mar 15 13:27:34 2011 New Revision: 219667 URL: http://svn.freebsd.org/changeset/base/219667 Log: Turn on softupdates by default. We need a UI to set filesystem parameters. Modified: head/usr.sbin/bsdinstall/partedit/gpart_ops.c This would appear to still be a change from the previous behaviour, where softupdates were enabled by default for any filesystem except for the root filesystem. It is -- and this needs to become settable. Bear in mind, however, that the default partition layout is also different. If you select the auto option, only one file system is made, so there are no non-root file systems. Hrm, I hadn't realised this was the case. If this change is intentional and planned to remain, I guess the various bits of documentation that say several partitions good, one bad should be updated... I wonder if it is time to start enabling SU+J on non-root filesystems now? That's certainly something to think about, although I'll defer whether that is wise to others. It's a little bit of a pain on the implementation side, since you can't turn it on from newfs, but that isn't a serious obstacle. As of r218726, you can now set this from newfs. (-j) Thanks, Gavin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219674 - head/share/man/man9
Author: jkim Date: Tue Mar 15 17:59:30 2011 New Revision: 219674 URL: http://svn.freebsd.org/changeset/base/219674 Log: Fix a typo in the previous commit. AMD64 and Intel 64 are two brand names. Modified: head/share/man/man9/get_cyclecount.9 Modified: head/share/man/man9/get_cyclecount.9 == --- head/share/man/man9/get_cyclecount.9Tue Mar 15 17:19:52 2011 (r219673) +++ head/share/man/man9/get_cyclecount.9Tue Mar 15 17:59:30 2011 (r219674) @@ -71,7 +71,9 @@ structure returned by .Xr binuptime 9 . .Pp The -.Tn AMD64 and Intel 64 +.Tn AMD64 +and +.Tn Intel 64 processors use the .Li TSC register. ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219675 - head/sys/i386/include
Author: jkim Date: Tue Mar 15 18:09:29 2011 New Revision: 219675 URL: http://svn.freebsd.org/changeset/base/219675 Log: Remove tsc_present from this file, really. Modified: head/sys/i386/include/cpu.h Modified: head/sys/i386/include/cpu.h == --- head/sys/i386/include/cpu.h Tue Mar 15 17:59:30 2011(r219674) +++ head/sys/i386/include/cpu.h Tue Mar 15 18:09:29 2011(r219675) @@ -56,7 +56,6 @@ #ifdef _KERNEL extern charbtext[]; extern charetext[]; -extern int tsc_present; void cpu_halt(void); void cpu_reset(void); ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219646 - head/sys/x86/isa
On Tue, 15 Mar 2011, Jung-uk Kim wrote: On Monday 14 March 2011 10:31 pm, Bruce Evans wrote: On Mon, 14 Mar 2011, Jung-uk Kim wrote: Log: When TSC is unavailable, broken or disabled and the current timecounter has better quality than i8254 timer, use it for DELAY(9). You cannot use a random timecounter for DELAY(). DELAY() is carefully written to not use any locks, so that it doesn't deadlock when called in the any context from a bad console driver like syscons when syscons is called from ddb. (Bad console drivers may have their own locks which deadlock in ddb, but that is another problem.) Even the i8254 timer, which is the only timer that should be used by DELAY(), normally use locks that used to cause deadlock, but DELAY() was unbroken to bypass the locks when it is called from ddb. I disagree. I think we should keep away from i8254 as much as possible. It is adequate for DELAY(), and is the only timer that is available on all x86. You need large complications in DELAY() to make it work as well as the old code using the i8254, for no gain until there is an x86 without an i8254. Actually, i8254 is the only timer that requires locking in the first place because of its braindead design. All other x86 timers do not require any locking at all. We even sacrificed upper 32 bits of HPET in favor of i386. :-( Did we? Timecounters use only 32 bits as an optimization. Scaling of 64-bit values is slow even on 64-bit machines since it needs 128-bit intermediate values for the multiplication/shift method to work. Cpufreq and other calibration code should use a normal timecounter via nanouptime() in all cases and never go near low level timecounters or DELAY(). There are (hopefully minor) problems getting the nanotime() initialized before it used. The dummy timecounter is just what you don't want to use. That's exactly the problem. Your fix won't make much difference then. DELAY() will start with a dummy timecounter and probably also a zero tsc_freq, so it will use the i8254 for various things, probably including initial calibration of the TSC/cpufreq. Later it may see a better timecounter and use that to get a better calibration of the TSC/cpufreq. But its caller can just as easily check for a better timecounter and not use DELAY() if it can use a timecounter, without messing with DELAY()'s internals and having to guard against reentrancy from ddb. delay_timecounter() already has all the code for this, except the check for a better timecounter is external. Even in this patch, it isn't clear that the low level timecounters are initialized before they are used. The timecounter is always initialized first, then set. It is still unclear whether they are initialized enough before they are used since their setting is neither locked nor atomic. Consider the TSC initialization. This is init_TSC() from startrtclock() and init_TSC_tc() from cpu_initclocks(). The first should make the low- level timecounter useable, but this is unclear. The second attaches the low-level timecounter to the high-level timecounter data structures. There is no locking for this except possibly Giant. tsc_freq is initialized early, so the tests of it will succeed long before the TSC can become the high-level timecounter. It is probably usable at a low level, but this is unclear. tsc_freq is 64 bits, and the accesses to it are non-atomic, so especially on 32-bit machines there are races accessing it. In fact, I can now see a reproducible bug in DELAY(): - find an x86 that can run at 4GHz - run it in 386 mode - start it so that tsc_freq is 0x1000ULL - use the machdep.tsc_freq sysctl to tune tsc_freq to 0x - trace through this sysctl using gdb, and using a low quality console driver like syscons which calls DELAY(). - the 2 words in tsc_freq will normally be written from the low word up. It will be seen to have value 0x1ULL after only the first word is written. Not too bad -- just of by a factor of 2. - I can't quite see how to make it have a really broken value. At first I tried and example with it starting with a value if 0x and changing it to 0x1ULL. Then after changing only its low word, it is 0 so DELAY() will not use the TSC. Related non-reproducible bugs are also easy to see: - on one CPU, spin calling the sysctl to toggly tsc_freq between 4G-1 and 4G - on another CPU, spin doing something that calls DELAY(). Since there is no locking or atomic accesses for the writes to tsc_freq in the sysctl or for the reads of it in DELAY(), not to mention elsewhwere, tsc_freq can read as zero when it is being changed between 2 nonzero values. Not too bad if it reads as zero -- then it won't be used. But uses of it following it being read as nonzero may find it with changed values that are very bad, for example zero. These bugs are in the old code in DELAY() that uses the TSC, and perhaps in all code of the form if (tsc_freq != 0) use(tsc).
Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include
On Tue, 15 Mar 2011, Jung-uk Kim wrote: Log: Unconditionally use binuptime(9) for get_cyclecount(9) on i386. Since this function is almost exclusively used for random harvesting, there is no need for micro-optimization. Adjust the manual page accordingly. That's what I said when it was being committed, but it isn't clear that there is _no_ need for micro-optimization in random harvesting. IIRC, random harvesting originally was too active so it benefited more from micro-optimizations. The timecounter is fast enough if the timecounter hardware is the TSC, since TSC reads used to take 12 cycles on Athlons and now take 40+, and timecounter software overhead only adds about 30 cycles to this. But now the timecounter harware is even more rarely the TSC, and most timecounter hardware is very slow -- about 3000 cycles for APCI-fast and 9000 for ACPI and 15000 for i8254 at 3 GHz. Modified: head/sys/i386/include/cpu.h == --- head/sys/i386/include/cpu.h Tue Mar 15 16:50:17 2011(r219671) +++ head/sys/i386/include/cpu.h Tue Mar 15 17:14:26 2011(r219672) @@ -70,15 +70,10 @@ voidswi_vm(void *); static __inline uint64_t get_cyclecount(void) { -#if defined(I486_CPU) || defined(KLD_MODULE) struct bintime bt; - if (!tsc_present) { - binuptime(bt); - return ((uint64_t)bt.sec 56 | bt.frac 8); - } -#endif - return (rdtsc()); + binuptime(bt); + return ((uint64_t)bt.sec 56 | bt.frac 8); } You should pessimize all arches to use binuptime() to get enough test coverage to see if anyone notices. Then get_cyclecount() can be removed. The correct function to use for fast and possibly-wrong times is clock_binuptime(CLOCK_FASTEST, tsp), where CLOCK_FASTEST maps to CLOCK_TSC on x86 if there is a TSC and nothing faster. Bruce ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219646 - head/sys/x86/isa
On Tuesday 15 March 2011 02:13 pm, Bruce Evans wrote: On Tue, 15 Mar 2011, Jung-uk Kim wrote: On Monday 14 March 2011 10:31 pm, Bruce Evans wrote: On Mon, 14 Mar 2011, Jung-uk Kim wrote: Log: When TSC is unavailable, broken or disabled and the current timecounter has better quality than i8254 timer, use it for DELAY(9). You cannot use a random timecounter for DELAY(). DELAY() is carefully written to not use any locks, so that it doesn't deadlock when called in the any context from a bad console driver like syscons when syscons is called from ddb. (Bad console drivers may have their own locks which deadlock in ddb, but that is another problem.) Even the i8254 timer, which is the only timer that should be used by DELAY(), normally use locks that used to cause deadlock, but DELAY() was unbroken to bypass the locks when it is called from ddb. I disagree. I think we should keep away from i8254 as much as possible. It is adequate for DELAY(), and is the only timer that is available on all x86. You need large complications in DELAY() to make it work as well as the old code using the i8254, for no gain until there is an x86 without an i8254. Intel started killing off i8254 (and other legacy ISA devices), starting from Mobile Internet Device platforms. Even for other so-called legacy-free platforms, it isn't adequate any more because of unpredictable SMI# interference. Actually, i8254 is the only timer that requires locking in the first place because of its braindead design. All other x86 timers do not require any locking at all. We even sacrificed upper 32 bits of HPET in favor of i386. :-( Did we? Timecounters use only 32 bits as an optimization. Scaling of 64-bit values is slow even on 64-bit machines since it needs 128-bit intermediate values for the multiplication/shift method to work. No, I am talking about reading raw value of HPET. For amd64, it can be used as a good alternative to TSC if we detect it earlier for legacy-free platforms. Unfortunately, it is only useful for timecounter ATM. Cpufreq and other calibration code should use a normal timecounter via nanouptime() in all cases and never go near low level timecounters or DELAY(). There are (hopefully minor) problems getting the nanotime() initialized before it used. The dummy timecounter is just what you don't want to use. That's exactly the problem. Your fix won't make much difference then. DELAY() will start with a dummy timecounter and probably also a zero tsc_freq, so it will use the i8254 for various things, probably including initial calibration of the TSC/cpufreq. Later it may see a better timecounter and use that to get a better calibration of the TSC/cpufreq. But its caller can just as easily check for a better timecounter and not use DELAY() if it can use a timecounter, without messing with DELAY()'s internals and having to guard against reentrancy from ddb. delay_timecounter() already has all the code for this, except the check for a better timecounter is external. Yes, it doesn't make much difference for that ATM. However, it DOES make differences when DELAY() is used for device drivers. What I really want is DELAY() does the right thing, e.g., holding no spin lock, not pinned on a CPU, no tsc_freq hackery, and no side-effect of any kind. Even in this patch, it isn't clear that the low level timecounters are initialized before they are used. The timecounter is always initialized first, then set. It is still unclear whether they are initialized enough before they are used since their setting is neither locked nor atomic. Consider the TSC initialization. This is init_TSC() from startrtclock() and init_TSC_tc() from cpu_initclocks(). The first should make the low- level timecounter useable, but this is unclear. The second attaches the low-level timecounter to the high-level timecounter data structures. There is no locking for this except possibly Giant. tsc_freq is initialized early, so the tests of it will succeed long before the TSC can become the high-level timecounter. It is probably usable at a low level, but this is unclear. tsc_freq is 64 bits, and the accesses to it are non-atomic, so especially on 32-bit machines there are races accessing it. In fact, I can now see a reproducible bug in DELAY(): - find an x86 that can run at 4GHz - run it in 386 mode - start it so that tsc_freq is 0x1000ULL - use the machdep.tsc_freq sysctl to tune tsc_freq to 0x machdep.tsc_freq should never have modified tsc_freq in the first place. I am going to remove that soon. - trace through this sysctl using gdb, and using a low quality console driver like syscons which calls DELAY(). - the 2 words in tsc_freq will normally be written from the low word up. It will be seen to have value 0x1ULL after only the first word is written. Not too bad -- just of by a factor of 2. - I
Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include
Hello! On Tue, Mar 15, 2011 at 05:14:26PM +, Jung-uk Kim wrote: Author: jkim Date: Tue Mar 15 17:14:26 2011 New Revision: 219672 URL: http://svn.freebsd.org/changeset/base/219672 Log: Unconditionally use binuptime(9) for get_cyclecount(9) on i386. Since this function is almost exclusively used for random harvesting, there is no need for micro-optimization. Adjust the manual page accordingly. Note that on early boot only dummy timecounter available, and binuptime() has no entropy. As a result of this change random(9) won't have entropy on early boot on i386, and arc4random(9) as well. While there are no known major security problems associated with it - it at least makes stack protector easily bypasseable as it now (again after r198295) uses well-known stack guard instead of random one. And there may be other issues as well. Hope you thought well before moving i386 to a set of platforms which have no early boot randomness at all. And you have good reason for doing it. Maxim Dounin Modified: head/share/man/man9/get_cyclecount.9 head/sys/i386/include/cpu.h Modified: head/share/man/man9/get_cyclecount.9 == --- head/share/man/man9/get_cyclecount.9 Tue Mar 15 16:50:17 2011 (r219671) +++ head/share/man/man9/get_cyclecount.9 Tue Mar 15 17:14:26 2011 (r219672) @@ -24,7 +24,7 @@ .\ .\ $FreeBSD$ .\ -.Dd October 24, 2009 +.Dd March 15, 2011 .Dt GET_CYCLECOUNT 9 .Os .Sh NAME @@ -65,14 +65,14 @@ do not have such a register, so .Fn get_cyclecount on these platforms -returns a (non-monotonic) combination of numbers +returns a (monotonic) combination of numbers represented by the structure returned by .Xr binuptime 9 . .Pp The -.Tn Pentium -processors all use the +.Tn AMD64 and Intel 64 +processors use the .Li TSC register. .Pp Modified: head/sys/i386/include/cpu.h == --- head/sys/i386/include/cpu.h Tue Mar 15 16:50:17 2011 (r219671) +++ head/sys/i386/include/cpu.h Tue Mar 15 17:14:26 2011 (r219672) @@ -70,15 +70,10 @@ void swi_vm(void *); static __inline uint64_t get_cyclecount(void) { -#if defined(I486_CPU) || defined(KLD_MODULE) struct bintime bt; - if (!tsc_present) { - binuptime(bt); - return ((uint64_t)bt.sec 56 | bt.frac 8); - } -#endif - return (rdtsc()); + binuptime(bt); + return ((uint64_t)bt.sec 56 | bt.frac 8); } #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219676 - head/sys/x86/x86
Author: jkim Date: Tue Mar 15 19:47:20 2011 New Revision: 219676 URL: http://svn.freebsd.org/changeset/base/219676 Log: Do not let machdep.tsc_freq modify tsc_freq itself. It is bad for i386 as it does not operate atomically. Actually, it serves no purpose. Noticed by: bde Modified: head/sys/x86/x86/tsc.c Modified: head/sys/x86/x86/tsc.c == --- head/sys/x86/x86/tsc.c Tue Mar 15 18:09:29 2011(r219675) +++ head/sys/x86/x86/tsc.c Tue Mar 15 19:47:20 2011(r219676) @@ -263,12 +263,10 @@ sysctl_machdep_tsc_freq(SYSCTL_HANDLER_A if (tsc_timecounter.tc_frequency == 0) return (EOPNOTSUPP); - freq = tsc_freq; + freq = tsc_timecounter.tc_frequency; error = sysctl_handle_64(oidp, freq, 0, req); - if (error == 0 req-newptr != NULL) { - tsc_freq = freq; - tsc_timecounter.tc_frequency = tsc_freq; - } + if (error == 0 req-newptr != NULL) + tsc_timecounter.tc_frequency = freq; return (error); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include
On Tuesday 15 March 2011 03:33 pm, Maxim Dounin wrote: Hello! On Tue, Mar 15, 2011 at 05:14:26PM +, Jung-uk Kim wrote: Author: jkim Date: Tue Mar 15 17:14:26 2011 New Revision: 219672 URL: http://svn.freebsd.org/changeset/base/219672 Log: Unconditionally use binuptime(9) for get_cyclecount(9) on i386. Since this function is almost exclusively used for random harvesting, there is no need for micro-optimization. Adjust the manual page accordingly. Note that on early boot only dummy timecounter available, and binuptime() has no entropy. As a result of this change random(9) won't have entropy on early boot on i386, and arc4random(9) as well. While there are no known major security problems associated with it - it at least makes stack protector easily bypasseable as it now (again after r198295) uses well-known stack guard instead of random one. And there may be other issues as well. Hope you thought well before moving i386 to a set of platforms which have no early boot randomness at all. And you have good reason for doing it. Hmm... Is bintime(9) good enough for you then? Jung-uk Kim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219677 - stable/8/sys/kern
Author: jilles Date: Tue Mar 15 20:24:21 2011 New Revision: 219677 URL: http://svn.freebsd.org/changeset/base/219677 Log: MFC r218019: Do not trip a KASSERT if /dev/null cannot be opened for a setuid program. The fdcheckstd() function makes sure fds 0, 1 and 2 are open by opening /dev/null. If this fails (e.g. missing devfs or wrong permissions), fdcheckstd() will return failure and the process will exit as if it received SIGABRT. The KASSERT is only to check that kern_open() returns the expected fd, given that it succeeded. Tripping the KASSERT is most likely if fd 0 is open but fd 1 or 2 are not. Modified: stable/8/sys/kern/kern_descrip.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/kern/kern_descrip.c == --- stable/8/sys/kern/kern_descrip.cTue Mar 15 19:47:20 2011 (r219676) +++ stable/8/sys/kern/kern_descrip.cTue Mar 15 20:24:21 2011 (r219677) @@ -2024,10 +2024,10 @@ fdcheckstd(struct thread *td) error = kern_open(td, /dev/null, UIO_SYSSPACE, O_RDWR, 0); devnull = td-td_retval[0]; - KASSERT(devnull == i, (oof, we didn't get our fd)); td-td_retval[0] = save; if (error) break; + KASSERT(devnull == i, (oof, we didn't get our fd)); } else { error = do_dup(td, DUP_FIXED, devnull, i, retval); if (error != 0) ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include
On Tuesday 15 March 2011 03:55 pm, Jung-uk Kim wrote: On Tuesday 15 March 2011 03:33 pm, Maxim Dounin wrote: Hello! On Tue, Mar 15, 2011 at 05:14:26PM +, Jung-uk Kim wrote: Author: jkim Date: Tue Mar 15 17:14:26 2011 New Revision: 219672 URL: http://svn.freebsd.org/changeset/base/219672 Log: Unconditionally use binuptime(9) for get_cyclecount(9) on i386. Since this function is almost exclusively used for random harvesting, there is no need for micro-optimization. Adjust the manual page accordingly. Note that on early boot only dummy timecounter available, and binuptime() has no entropy. As a result of this change random(9) won't have entropy on early boot on i386, and arc4random(9) as well. While there are no known major security problems associated with it - it at least makes stack protector easily bypasseable as it now (again after r198295) uses well-known stack guard instead of random one. And there may be other issues as well. Hope you thought well before moving i386 to a set of platforms which have no early boot randomness at all. And you have good reason for doing it. Hmm... Is bintime(9) good enough for you then? I guess it won't work cause boottimebin is set pretty late. Arg... If I can't come up with something sensible, I'll revert this commit. Jung-uk Kim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219646 - head/sys/x86/isa
On Tuesday, March 15, 2011 3:26:11 pm Jung-uk Kim wrote: Now don't you think we should really kill delay by TSC? ;-) Delay by TSC fixed known deadlocks with the i8254 based DELAY() due to the use of locks. Be careful that you don't re-introduce old bugs. Also, you can use a TSC for DELAY() in cases when it is not safe to use it for the timecounter (if it is not in sync across cores, but is used in a machine with invariant TSCs or where the user knows they won't ever throttle it). Modern Intel CPUs all have invariant TSCs that are more or less in sync across cores, and we should certainly still use the TSC for DELAY() in that case. Even if they aren't in sync (so we can't use it for the timecounter) we should still use the TSC if they are invariant as it is far cheaper than anything else. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219676 - head/sys/x86/x86
On Tuesday, March 15, 2011 3:47:20 pm Jung-uk Kim wrote: Author: jkim Date: Tue Mar 15 19:47:20 2011 New Revision: 219676 URL: http://svn.freebsd.org/changeset/base/219676 Log: Do not let machdep.tsc_freq modify tsc_freq itself. It is bad for i386 as it does not operate atomically. Actually, it serves no purpose. Noticed by: bde Ouch, please revert! We have depended on this for testing to workaround BIOS issues (e.g. the USB SMI# handler firing at a bad time during boot causing the TSC frequency to be calculated incorrectly). I agree it's a hack that this works, but it has actually proven useful in the past. -- John Baldwin ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219676 - head/sys/x86/x86
On Tuesday 15 March 2011 05:01 pm, John Baldwin wrote: On Tuesday, March 15, 2011 3:47:20 pm Jung-uk Kim wrote: Author: jkim Date: Tue Mar 15 19:47:20 2011 New Revision: 219676 URL: http://svn.freebsd.org/changeset/base/219676 Log: Do not let machdep.tsc_freq modify tsc_freq itself. It is bad for i386 as it does not operate atomically. Actually, it serves no purpose. Noticed by: bde Ouch, please revert! We have depended on this for testing to workaround BIOS issues (e.g. the USB SMI# handler firing at a bad time during boot causing the TSC frequency to be calculated incorrectly). I agree it's a hack that this works, but it has actually proven useful in the past. You can still change timecounter frequency. Can you please explain why you need to change tsc_freq directly? Jung-uk Kim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219646 - head/sys/x86/isa
On Tuesday 15 March 2011 03:51 pm, John Baldwin wrote: On Tuesday, March 15, 2011 3:26:11 pm Jung-uk Kim wrote: Now don't you think we should really kill delay by TSC? ;-) Delay by TSC fixed known deadlocks with the i8254 based DELAY() due to the use of locks. Be careful that you don't re-introduce old bugs. Yeah, that's perfectly understood. Also, you can use a TSC for DELAY() in cases when it is not safe to use it for the timecounter (if it is not in sync across cores, but is used in a machine with invariant TSCs or where the user knows they won't ever throttle it). Modern Intel CPUs all have invariant TSCs that are more or less in sync across cores, and we should certainly still use the TSC for DELAY() in that case. Even if they aren't in sync (so we can't use it for the timecounter) we should still use the TSC if they are invariant as it is far cheaper than anything else. That, too, is well understood. You know I added tsc_is_invariant myself. :-) However, why do we need cheaper DELAY() when we trying to delay something with it? Jung-uk Kim ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219646 - head/sys/x86/isa
On Tue, Mar 15, 2011 at 05:21:34PM -0400, Jung-uk Kim wrote: However, why do we need cheaper DELAY() when we trying to delay something with it? Busy-loop performing repeated access to the south bridge eats the bus capacity, that could be useful for other bus agent and other cores. I think this is the case with HPET, while TSC is core-local. pgp874pQWyLYv.pgp Description: PGP signature
svn commit: r219678 - stable/8/share/man/man4
Author: ken Date: Tue Mar 15 21:34:10 2011 New Revision: 219678 URL: http://svn.freebsd.org/changeset/base/219678 Log: MFC: 212624, 212669, 213535 Merge the mps(4) man page. r212624 | ken | 2010-09-14 15:40:29 -0600 (Tue, 14 Sep 2010) | 7 lines MFp4 (//depot/projects/mps/...) Add a man page for the mps(4) driver, and reference it in the mpt(4) driver man page. Sponsored by: Spectra Logic Corporation r212669 | ken | 2010-09-15 10:05:51 -0600 (Wed, 15 Sep 2010) | 6 lines MFp4 (//depot/projects/mps/...) Fix a typo. Submitted by: pluknet at gmail dot com r213535 | ken | 2010-10-07 15:56:10 -0600 (Thu, 07 Oct 2010) | 36 lines Turn on serialization of task management commands going down to the controller, but make it optional. After a problem report from Andrew Boyer, it looks like the LSI chip may have issues (the watchdog timer fired) if too many aborts are sent down to the chip at the same time. We know that task management commands are serialized, and although the manual doesn't say it, it may be a good idea to just send one at a time. But, since I'm not certain that this is necessary, add a tunable and sysctl variable (hw.mps.%d.allow_multiple_tm_cmds) to control the driver's behavior. mps.c: Add support for the sysctl and tunable, and add a comment about the possible return values to mps_map_command(). mps_sas.c: Run all task management commands through two new routines, mpssas_issue_tm_request() and mpssas_complete_tm_request(). This allows us to optionally serialize task management commands. Also, change things so that the response to a task management command always comes back through the callback. (Before it could come via the callback or the return value.) mpsvar.h: Add softc variables for the list of active task management commands, the number of active commands, and whether we should allow multiple active task management commands. Add an active command flag. mps.4: Describe the new sysctl/loader tunable variable. Sponsored by: Spectra Logic Corporation Reminded by: Hubert Tournier hubert at frbsd dot org Added: stable/8/share/man/man4/mps.4 - copied, changed from r212624, head/share/man/man4/mps.4 Modified: stable/8/share/man/man4/Makefile stable/8/share/man/man4/mpt.4 Directory Properties: stable/8/share/man/man4/ (props changed) Modified: stable/8/share/man/man4/Makefile == --- stable/8/share/man/man4/MakefileTue Mar 15 20:24:21 2011 (r219677) +++ stable/8/share/man/man4/MakefileTue Mar 15 21:34:10 2011 (r219678) @@ -218,6 +218,7 @@ MAN=aac.4 \ mmcsd.4 \ mn.4 \ mouse.4 \ + mps.4 \ mpt.4 \ msk.4 \ mtio.4 \ Copied and modified: stable/8/share/man/man4/mps.4 (from r212624, head/share/man/man4/mps.4) == --- head/share/man/man4/mps.4 Tue Sep 14 21:40:29 2010(r212624, copy source) +++ stable/8/share/man/man4/mps.4 Tue Mar 15 21:34:10 2011 (r219678) @@ -31,7 +31,7 @@ .\ .\ Author: Ken Merry k...@freebsd.org .\ -.\ $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#1 $ +.\ $Id: //depot/SpectraBSD/head/share/man/man4/mps.4#4 $ .\ $FreeBSD$ .\ .Dd September 13, 2010 @@ -51,7 +51,7 @@ place the following lines in your kernel Or, to load the driver as a module at boot, place the following line in .Xr loader.conf 5 : .Bd -literal -offset indent -mpt_load=YES +mps_load=YES .Ed .Sh DESCRIPTION The @@ -97,6 +97,20 @@ driver instances, set the following tuna .Bd -literal -offset indent hw.mps.disable_msix=1 .Ed +.Pp +To allow the driver to send multiple task management commands (like abort, +LUN reset, etc.), set the following variable: +.Bd -literal -offset indent +hw.mps.X.allow_multiple_tm_cmds=1 +.Ed +.Pp +via +.Xr loader.conf 5 +or +.Xr sysctl 8 , +where X is the adapter number. +By default the driver only sends one task management command at a time, to +avoid causing a potential controller lock-up. .Sh DEBUGGING To enable debugging prints from the .Nm Modified: stable/8/share/man/man4/mpt.4 == --- stable/8/share/man/man4/mpt.4 Tue Mar 15 20:24:21 2011 (r219677) +++ stable/8/share/man/man4/mpt.4 Tue Mar 15 21:34:10 2011 (r219678) @@ -152,6 +152,7 @@ can take on - no separate compilation is .Xr cd 4 , .Xr ch 4 , .Xr da 4 , +.Xr mps 4 , .Xr pci 4 , .Xr sa 4 , .Xr scsi 4 ,
svn commit: r219679 - head/sys/i386/include
Author: jkim Date: Tue Mar 15 21:45:10 2011 New Revision: 219679 URL: http://svn.freebsd.org/changeset/base/219679 Log: Partially revert r219672. After r198295, kernel need to seed randomness as soon as possible for stack protector. However, dummy timecounter does not have enough entropy and we don't need to sacrifice Pentium class and later. Pointed out by: Maxim Dounin (mdounin at mdounin dot ru) Modified: head/sys/i386/include/cpu.h Modified: head/sys/i386/include/cpu.h == --- head/sys/i386/include/cpu.h Tue Mar 15 21:34:10 2011(r219678) +++ head/sys/i386/include/cpu.h Tue Mar 15 21:45:10 2011(r219679) @@ -69,10 +69,14 @@ voidswi_vm(void *); static __inline uint64_t get_cyclecount(void) { +#if defined(I486_CPU) || defined(KLD_MODULE) struct bintime bt; binuptime(bt); return ((uint64_t)bt.sec 56 | bt.frac 8); +#else + return (rdtsc()); +#endif } #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219680 - in head/bin: ln rm test
Author: jilles Date: Tue Mar 15 22:22:11 2011 New Revision: 219680 URL: http://svn.freebsd.org/changeset/base/219680 Log: bin: Prefer strrchr() to rindex(). This removes the last index/rindex usage from /bin. Modified: head/bin/ln/ln.c head/bin/rm/rm.c head/bin/test/test.c Modified: head/bin/ln/ln.c == --- head/bin/ln/ln.cTue Mar 15 21:45:10 2011(r219679) +++ head/bin/ln/ln.cTue Mar 15 22:22:11 2011(r219680) @@ -80,7 +80,7 @@ main(int argc, char *argv[]) * link, for which the functionality provided is greatly * simplified. */ - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else ++p; Modified: head/bin/rm/rm.c == --- head/bin/rm/rm.cTue Mar 15 21:45:10 2011(r219679) +++ head/bin/rm/rm.cTue Mar 15 22:22:11 2011(r219680) @@ -90,7 +90,7 @@ main(int argc, char *argv[]) * unlink, for which the functionality provided is greatly * simplified. */ - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else ++p; Modified: head/bin/test/test.c == --- head/bin/test/test.cTue Mar 15 21:45:10 2011(r219679) +++ head/bin/test/test.cTue Mar 15 22:22:11 2011(r219680) @@ -194,7 +194,7 @@ main(int argc, char **argv) int res; char*p; - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else p++; ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219680 - in head/bin: ln rm test
On Tue Mar 15 11, Jilles Tjoelker wrote: Author: jilles Date: Tue Mar 15 22:22:11 2011 New Revision: 219680 URL: http://svn.freebsd.org/changeset/base/219680 Log: bin: Prefer strrchr() to rindex(). shouldn't the rindex(3) manual contain a note regarding it's depricated nature and the fact that strchr(3) is preferred? cheers. alex This removes the last index/rindex usage from /bin. Modified: head/bin/ln/ln.c head/bin/rm/rm.c head/bin/test/test.c Modified: head/bin/ln/ln.c == --- head/bin/ln/ln.c Tue Mar 15 21:45:10 2011(r219679) +++ head/bin/ln/ln.c Tue Mar 15 22:22:11 2011(r219680) @@ -80,7 +80,7 @@ main(int argc, char *argv[]) * link, for which the functionality provided is greatly * simplified. */ - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else ++p; Modified: head/bin/rm/rm.c == --- head/bin/rm/rm.c Tue Mar 15 21:45:10 2011(r219679) +++ head/bin/rm/rm.c Tue Mar 15 22:22:11 2011(r219680) @@ -90,7 +90,7 @@ main(int argc, char *argv[]) * unlink, for which the functionality provided is greatly * simplified. */ - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else ++p; Modified: head/bin/test/test.c == --- head/bin/test/test.c Tue Mar 15 21:45:10 2011(r219679) +++ head/bin/test/test.c Tue Mar 15 22:22:11 2011(r219680) @@ -194,7 +194,7 @@ main(int argc, char **argv) int res; char*p; - if ((p = rindex(argv[0], '/')) == NULL) + if ((p = strrchr(argv[0], '/')) == NULL) p = argv[0]; else p++; -- a13x ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219683 - head/sys/boot/efi/libefi
Author: marcel Date: Wed Mar 16 00:08:10 2011 New Revision: 219683 URL: http://svn.freebsd.org/changeset/base/219683 Log: Revert previous commit: EFI_STATUS is a 64-bit integral on ia64. Fix the compile warning on i386 (where EFI_STATUS is a 32-bit integral) by casting the status argument to u_long instead. Pointy hat: brucec MFC after: 3 days Modified: head/sys/boot/efi/libefi/efipart.c Modified: head/sys/boot/efi/libefi/efipart.c == --- head/sys/boot/efi/libefi/efipart.c Tue Mar 15 23:51:47 2011 (r219682) +++ head/sys/boot/efi/libefi/efipart.c Wed Mar 16 00:08:10 2011 (r219683) @@ -204,7 +204,7 @@ efipart_readwrite(EFI_BLOCK_IO *blkio, i } if (EFI_ERROR(status)) - printf(%s: rw=%d, status=%u\n, __func__, rw, status); + printf(%s: rw=%d, status=%lu\n, __func__, rw, (u_long)status); return (efi_status_to_errno(status)); } ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219684 - head/sys/arm/mv
Author: marcel Date: Wed Mar 16 00:42:15 2011 New Revision: 219684 URL: http://svn.freebsd.org/changeset/base/219684 Log: Fix mv_gpio_in() for pin numbers that occupy bits 8-31 in GPIO registers. The compiler will truncate the 32-bit return value of mv_gpio_value_get() to match the 8-bit return value of mv_gpio_in(). A conditional expression is used to have mv_gpio_in() always return 0 or 1 instead. Modified: head/sys/arm/mv/gpio.c Modified: head/sys/arm/mv/gpio.c == --- head/sys/arm/mv/gpio.c Wed Mar 16 00:08:10 2011(r219683) +++ head/sys/arm/mv/gpio.c Wed Mar 16 00:42:15 2011(r219684) @@ -344,7 +344,7 @@ uint8_t mv_gpio_in(uint32_t pin) { - return (mv_gpio_value_get(pin)); + return (mv_gpio_value_get(pin) ? 1 : 0); } static uint32_t ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219679 - head/sys/i386/include
Hello! On Tue, Mar 15, 2011 at 09:45:10PM +, Jung-uk Kim wrote: Author: jkim Date: Tue Mar 15 21:45:10 2011 New Revision: 219679 URL: http://svn.freebsd.org/changeset/base/219679 Log: Partially revert r219672. After r198295, kernel need to seed randomness as soon as possible for stack protector. However, dummy timecounter does not Not after, long before and not only for stack protector. The r198295 somewhat fixes things to actually make some randomness available early. have enough entropy and we don't need to sacrifice Pentium class and later. Pointed out by: Maxim Dounin (mdounin at mdounin dot ru) Modified: head/sys/i386/include/cpu.h Modified: head/sys/i386/include/cpu.h == --- head/sys/i386/include/cpu.h Tue Mar 15 21:34:10 2011 (r219678) +++ head/sys/i386/include/cpu.h Tue Mar 15 21:45:10 2011 (r219679) @@ -69,10 +69,14 @@ void swi_vm(void *); static __inline uint64_t get_cyclecount(void) { +#if defined(I486_CPU) || defined(KLD_MODULE) struct bintime bt; binuptime(bt); return ((uint64_t)bt.sec 56 | bt.frac 8); +#else + return (rdtsc()); +#endif This isn't really different as long as GENERIC kernel used, as GENERIC defines I486_CPU. Maxim Dounin } #endif ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219685 - vendor/tzdata/dist
Author: edwin Date: Wed Mar 16 03:07:08 2011 New Revision: 219685 URL: http://svn.freebsd.org/changeset/base/219685 Log: Vendor import of tzdata2011d: - Pacific/Apia will have DST on 2 April instead of 3 April in 2011. - Turkye will go to DST on 28 April instead of 27 April in 2011. - Cuba will go to DST on 20 April in 2011. Obtained from:ftp://elsie.nci.nih.gov/pub/ Modified: vendor/tzdata/dist/australasia vendor/tzdata/dist/etcetera vendor/tzdata/dist/europe vendor/tzdata/dist/northamerica Modified: vendor/tzdata/dist/australasia == --- vendor/tzdata/dist/australasia Wed Mar 16 00:42:15 2011 (r219684) +++ vendor/tzdata/dist/australasia Wed Mar 16 03:07:08 2011 (r219685) @@ -1,5 +1,5 @@ # pre -# @(#)australasia 8.22 +# @(#)australasia 8.23 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -509,11 +509,31 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks # backwards from 1:00am to 12:00am +# From Raymond Hughes (2011-03-07) +# I believe this will be posted shortly on the website +# a href=http://www.mcil.gov.ws; +# www.mcil.gov.ws +# /a +# +# PUBLIC NOTICE ON DAYLIGHT SAVING TIME +# +# Pursuant to the Daylight Saving Act 2009 and Cabinets decision, +# businesses and the general public are hereby advised that daylight +# saving time is on the first Saturday of April 2011 (02/04/11). +# +# The public is therefore advised that when the standard time strikes +# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011, +# then all instruments used to measure standard time are to be +# adjusted/changed to three oclock (3:00am or 0300Hrs). +# +# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE, +# INDUSTRY AND LABOUR 28th February 2011 + Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5 -11:26:56 - LMT 1911 -11:30 - SAMT1950# Samoa Time -11:00 - WST 2010 Sep 26 - -11:00 1:00WSDT2011 Apr 3 1:00 + -11:00 1:00WSDT2011 Apr 2 4:00 -11:00 - WST # Solomon Is Modified: vendor/tzdata/dist/etcetera == --- vendor/tzdata/dist/etcetera Wed Mar 16 00:42:15 2011(r219684) +++ vendor/tzdata/dist/etcetera Wed Mar 16 03:07:08 2011(r219685) @@ -1,5 +1,5 @@ # pre -# @(#)etcetera 8.2 +# @(#)etcetera 8.3 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -36,8 +36,7 @@ Link Etc/GMT Etc/GMT0 # (i.e. west of Greenwich) even though many people would expect it to # mean 4 hours ahead of UTC (i.e. east of Greenwich). # -# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation -# (which is not yet supported by the tz code) allows for +# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for # TZ='GMT-4+4'; if you want time zone abbreviations conforming to # ISO 8601 you can use TZ='-0400+4'. Thus the commonly-expected # offset is kept within the angle bracket (and is used for display) Modified: vendor/tzdata/dist/europe == --- vendor/tzdata/dist/europe Wed Mar 16 00:42:15 2011(r219684) +++ vendor/tzdata/dist/europe Wed Mar 16 03:07:08 2011(r219685) @@ -1,5 +1,5 @@ # pre -# @(#)europe 8.27 +# @(#)europe 8.28 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -2483,25 +2483,18 @@ ZoneEurope/Zurich 0:34:08 - LMT 1848 Se # (on a non-government server though) describing dates between 2002 and 2006: # http://www.alomaliye.com/bkk_2002_3769.htm -# From Sue Williams (2008-08-11): -# I spotted this news article about a potential change in Turkey. -# -# a href=http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1; -# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1 +# From Gouml;kdeniz Karada#x011f; (2011-03-10): +# +# According to the articles linked below, Turkey will change into summer +# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27. +# This change is due to a nationwide exam on 27th. +# +# a href=http://www.worldbulletin.net/?aType=haberArticleID=70872; +# http://www.worldbulletin.net/?aType=haberArticleID=70872 # /a - -# From Sue Williams (2008-08-20): -# This article says that around the end of March 2011, Turkey wants to -# adjust the clocks forward by 1/2 hour and stay that way permanently. -# The article indicates that this is a change in timezone offset in addition -# to stopping observance of DST. -# This
svn commit: r219686 - vendor/tzdata/tzdata2011d
Author: edwin Date: Wed Mar 16 03:23:46 2011 New Revision: 219686 URL: http://svn.freebsd.org/changeset/base/219686 Log: Tag of tzdat2011d data. Added: vendor/tzdata/tzdata2011d/ - copied from r219685, vendor/tzdata/dist/ ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
svn commit: r219687 - head/contrib/tzdata
Author: edwin Date: Wed Mar 16 03:28:42 2011 New Revision: 219687 URL: http://svn.freebsd.org/changeset/base/219687 Log: MFV of r219685, tzdata2011d - Pacific/Apia will have DST on 2 April instead of 3 April in 2011. - Turkye will go to DST on 28 April instead of 27 April in 2011. - Cuba will go to DST on 20 April in 2011. Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: head/contrib/tzdata/australasia head/contrib/tzdata/etcetera head/contrib/tzdata/europe head/contrib/tzdata/northamerica Directory Properties: head/contrib/tzdata/ (props changed) Modified: head/contrib/tzdata/australasia == --- head/contrib/tzdata/australasia Wed Mar 16 03:23:46 2011 (r219686) +++ head/contrib/tzdata/australasia Wed Mar 16 03:28:42 2011 (r219687) @@ -1,5 +1,5 @@ # pre -# @(#)australasia 8.22 +# @(#)australasia 8.23 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -509,11 +509,31 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks # backwards from 1:00am to 12:00am +# From Raymond Hughes (2011-03-07) +# I believe this will be posted shortly on the website +# a href=http://www.mcil.gov.ws; +# www.mcil.gov.ws +# /a +# +# PUBLIC NOTICE ON DAYLIGHT SAVING TIME +# +# Pursuant to the Daylight Saving Act 2009 and Cabinets decision, +# businesses and the general public are hereby advised that daylight +# saving time is on the first Saturday of April 2011 (02/04/11). +# +# The public is therefore advised that when the standard time strikes +# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011, +# then all instruments used to measure standard time are to be +# adjusted/changed to three oclock (3:00am or 0300Hrs). +# +# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE, +# INDUSTRY AND LABOUR 28th February 2011 + Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5 -11:26:56 - LMT 1911 -11:30 - SAMT1950# Samoa Time -11:00 - WST 2010 Sep 26 - -11:00 1:00WSDT2011 Apr 3 1:00 + -11:00 1:00WSDT2011 Apr 2 4:00 -11:00 - WST # Solomon Is Modified: head/contrib/tzdata/etcetera == --- head/contrib/tzdata/etceteraWed Mar 16 03:23:46 2011 (r219686) +++ head/contrib/tzdata/etceteraWed Mar 16 03:28:42 2011 (r219687) @@ -1,5 +1,5 @@ # pre -# @(#)etcetera 8.2 +# @(#)etcetera 8.3 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -36,8 +36,7 @@ Link Etc/GMT Etc/GMT0 # (i.e. west of Greenwich) even though many people would expect it to # mean 4 hours ahead of UTC (i.e. east of Greenwich). # -# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation -# (which is not yet supported by the tz code) allows for +# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for # TZ='GMT-4+4'; if you want time zone abbreviations conforming to # ISO 8601 you can use TZ='-0400+4'. Thus the commonly-expected # offset is kept within the angle bracket (and is used for display) Modified: head/contrib/tzdata/europe == --- head/contrib/tzdata/europe Wed Mar 16 03:23:46 2011(r219686) +++ head/contrib/tzdata/europe Wed Mar 16 03:28:42 2011(r219687) @@ -1,5 +1,5 @@ # pre -# @(#)europe 8.27 +# @(#)europe 8.28 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -2483,25 +2483,18 @@ ZoneEurope/Zurich 0:34:08 - LMT 1848 Se # (on a non-government server though) describing dates between 2002 and 2006: # http://www.alomaliye.com/bkk_2002_3769.htm -# From Sue Williams (2008-08-11): -# I spotted this news article about a potential change in Turkey. -# -# a href=http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1; -# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1 +# From Gouml;kdeniz Karada#x011f; (2011-03-10): +# +# According to the articles linked below, Turkey will change into summer +# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27. +# This change is due to a nationwide exam on 27th. +# +# a href=http://www.worldbulletin.net/?aType=haberArticleID=70872; +# http://www.worldbulletin.net/?aType=haberArticleID=70872 # /a - -# From Sue Williams (2008-08-20): -# This article says that around the end of March 2011, Turkey wants to -# adjust the clocks forward by 1/2 hour and stay that way permanently. -# The article indicates that this is a change
svn commit: r219688 - stable/8/share/zoneinfo
Author: edwin Date: Wed Mar 16 03:34:12 2011 New Revision: 219688 URL: http://svn.freebsd.org/changeset/base/219688 Log: MFC of 219687, tzdata2011d: - Pacific/Apia will have DST on 2 April instead of 3 April in 2011. - Turkye will go to DST on 28 April instead of 27 April in 2011. - Cuba will go to DST on 20 April in 2011. Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: stable/8/share/zoneinfo/australasia stable/8/share/zoneinfo/etcetera stable/8/share/zoneinfo/europe stable/8/share/zoneinfo/northamerica Directory Properties: stable/8/share/zoneinfo/ (props changed) Modified: stable/8/share/zoneinfo/australasia == --- stable/8/share/zoneinfo/australasia Wed Mar 16 03:28:42 2011 (r219687) +++ stable/8/share/zoneinfo/australasia Wed Mar 16 03:34:12 2011 (r219688) @@ -1,5 +1,5 @@ # pre -# @(#)australasia 8.22 +# @(#)australasia 8.23 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -509,11 +509,31 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks # backwards from 1:00am to 12:00am +# From Raymond Hughes (2011-03-07) +# I believe this will be posted shortly on the website +# a href=http://www.mcil.gov.ws; +# www.mcil.gov.ws +# /a +# +# PUBLIC NOTICE ON DAYLIGHT SAVING TIME +# +# Pursuant to the Daylight Saving Act 2009 and Cabinets decision, +# businesses and the general public are hereby advised that daylight +# saving time is on the first Saturday of April 2011 (02/04/11). +# +# The public is therefore advised that when the standard time strikes +# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011, +# then all instruments used to measure standard time are to be +# adjusted/changed to three oclock (3:00am or 0300Hrs). +# +# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE, +# INDUSTRY AND LABOUR 28th February 2011 + Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5 -11:26:56 - LMT 1911 -11:30 - SAMT1950# Samoa Time -11:00 - WST 2010 Sep 26 - -11:00 1:00WSDT2011 Apr 3 1:00 + -11:00 1:00WSDT2011 Apr 2 4:00 -11:00 - WST # Solomon Is Modified: stable/8/share/zoneinfo/etcetera == --- stable/8/share/zoneinfo/etceteraWed Mar 16 03:28:42 2011 (r219687) +++ stable/8/share/zoneinfo/etceteraWed Mar 16 03:34:12 2011 (r219688) @@ -1,5 +1,5 @@ # pre -# @(#)etcetera 8.2 +# @(#)etcetera 8.3 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -36,8 +36,7 @@ Link Etc/GMT Etc/GMT0 # (i.e. west of Greenwich) even though many people would expect it to # mean 4 hours ahead of UTC (i.e. east of Greenwich). # -# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation -# (which is not yet supported by the tz code) allows for +# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for # TZ='GMT-4+4'; if you want time zone abbreviations conforming to # ISO 8601 you can use TZ='-0400+4'. Thus the commonly-expected # offset is kept within the angle bracket (and is used for display) Modified: stable/8/share/zoneinfo/europe == --- stable/8/share/zoneinfo/europe Wed Mar 16 03:28:42 2011 (r219687) +++ stable/8/share/zoneinfo/europe Wed Mar 16 03:34:12 2011 (r219688) @@ -1,5 +1,5 @@ # pre -# @(#)europe 8.27 +# @(#)europe 8.28 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -2483,25 +2483,18 @@ ZoneEurope/Zurich 0:34:08 - LMT 1848 Se # (on a non-government server though) describing dates between 2002 and 2006: # http://www.alomaliye.com/bkk_2002_3769.htm -# From Sue Williams (2008-08-11): -# I spotted this news article about a potential change in Turkey. -# -# a href=http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1; -# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1 +# From Gouml;kdeniz Karada#x011f; (2011-03-10): +# +# According to the articles linked below, Turkey will change into summer +# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27. +# This change is due to a nationwide exam on 27th. +# +# a href=http://www.worldbulletin.net/?aType=haberArticleID=70872; +# http://www.worldbulletin.net/?aType=haberArticleID=70872 # /a - -# From Sue Williams (2008-08-20): -# This article says that around the end of March 2011, Turkey wants to -# adjust the clocks forward by 1/2 hour and stay that way
svn commit: r219689 - stable/7/share/zoneinfo
Author: edwin Date: Wed Mar 16 03:34:41 2011 New Revision: 219689 URL: http://svn.freebsd.org/changeset/base/219689 Log: MFC of 219687, tzdata2011d: - Pacific/Apia will have DST on 2 April instead of 3 April in 2011. - Turkye will go to DST on 28 April instead of 27 April in 2011. - Cuba will go to DST on 20 April in 2011. Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: stable/7/share/zoneinfo/australasia stable/7/share/zoneinfo/etcetera stable/7/share/zoneinfo/europe stable/7/share/zoneinfo/northamerica Directory Properties: stable/7/share/zoneinfo/ (props changed) Modified: stable/7/share/zoneinfo/australasia == --- stable/7/share/zoneinfo/australasia Wed Mar 16 03:34:12 2011 (r219688) +++ stable/7/share/zoneinfo/australasia Wed Mar 16 03:34:41 2011 (r219689) @@ -1,5 +1,5 @@ # pre -# @(#)australasia 8.22 +# @(#)australasia 8.23 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -509,11 +509,31 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks # backwards from 1:00am to 12:00am +# From Raymond Hughes (2011-03-07) +# I believe this will be posted shortly on the website +# a href=http://www.mcil.gov.ws; +# www.mcil.gov.ws +# /a +# +# PUBLIC NOTICE ON DAYLIGHT SAVING TIME +# +# Pursuant to the Daylight Saving Act 2009 and Cabinets decision, +# businesses and the general public are hereby advised that daylight +# saving time is on the first Saturday of April 2011 (02/04/11). +# +# The public is therefore advised that when the standard time strikes +# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011, +# then all instruments used to measure standard time are to be +# adjusted/changed to three oclock (3:00am or 0300Hrs). +# +# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE, +# INDUSTRY AND LABOUR 28th February 2011 + Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5 -11:26:56 - LMT 1911 -11:30 - SAMT1950# Samoa Time -11:00 - WST 2010 Sep 26 - -11:00 1:00WSDT2011 Apr 3 1:00 + -11:00 1:00WSDT2011 Apr 2 4:00 -11:00 - WST # Solomon Is Modified: stable/7/share/zoneinfo/etcetera == --- stable/7/share/zoneinfo/etceteraWed Mar 16 03:34:12 2011 (r219688) +++ stable/7/share/zoneinfo/etceteraWed Mar 16 03:34:41 2011 (r219689) @@ -1,5 +1,5 @@ # pre -# @(#)etcetera 8.2 +# @(#)etcetera 8.3 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -36,8 +36,7 @@ Link Etc/GMT Etc/GMT0 # (i.e. west of Greenwich) even though many people would expect it to # mean 4 hours ahead of UTC (i.e. east of Greenwich). # -# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation -# (which is not yet supported by the tz code) allows for +# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for # TZ='GMT-4+4'; if you want time zone abbreviations conforming to # ISO 8601 you can use TZ='-0400+4'. Thus the commonly-expected # offset is kept within the angle bracket (and is used for display) Modified: stable/7/share/zoneinfo/europe == --- stable/7/share/zoneinfo/europe Wed Mar 16 03:34:12 2011 (r219688) +++ stable/7/share/zoneinfo/europe Wed Mar 16 03:34:41 2011 (r219689) @@ -1,5 +1,5 @@ # pre -# @(#)europe 8.27 +# @(#)europe 8.28 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -2483,25 +2483,18 @@ ZoneEurope/Zurich 0:34:08 - LMT 1848 Se # (on a non-government server though) describing dates between 2002 and 2006: # http://www.alomaliye.com/bkk_2002_3769.htm -# From Sue Williams (2008-08-11): -# I spotted this news article about a potential change in Turkey. -# -# a href=http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1; -# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1 +# From Gouml;kdeniz Karada#x011f; (2011-03-10): +# +# According to the articles linked below, Turkey will change into summer +# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27. +# This change is due to a nationwide exam on 27th. +# +# a href=http://www.worldbulletin.net/?aType=haberArticleID=70872; +# http://www.worldbulletin.net/?aType=haberArticleID=70872 # /a - -# From Sue Williams (2008-08-20): -# This article says that around the end of March 2011, Turkey wants to -# adjust the clocks forward by 1/2 hour and stay that way
svn commit: r219690 - stable/6/share/zoneinfo
Author: edwin Date: Wed Mar 16 03:35:12 2011 New Revision: 219690 URL: http://svn.freebsd.org/changeset/base/219690 Log: MFC of 219687, tzdata2011d: - Pacific/Apia will have DST on 2 April instead of 3 April in 2011. - Turkye will go to DST on 28 April instead of 27 April in 2011. - Cuba will go to DST on 20 April in 2011. Obtained from: ftp://elsie.nci.nih.gov/pub/ Modified: stable/6/share/zoneinfo/australasia stable/6/share/zoneinfo/etcetera stable/6/share/zoneinfo/europe stable/6/share/zoneinfo/northamerica Directory Properties: stable/6/share/zoneinfo/ (props changed) Modified: stable/6/share/zoneinfo/australasia == --- stable/6/share/zoneinfo/australasia Wed Mar 16 03:34:41 2011 (r219689) +++ stable/6/share/zoneinfo/australasia Wed Mar 16 03:35:12 2011 (r219690) @@ -1,5 +1,5 @@ # pre -# @(#)australasia 8.22 +# @(#)australasia 8.23 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -509,11 +509,31 @@ Zone Pacific/Pago_Pago 12:37:12 - LMT 1 # to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks # backwards from 1:00am to 12:00am +# From Raymond Hughes (2011-03-07) +# I believe this will be posted shortly on the website +# a href=http://www.mcil.gov.ws; +# www.mcil.gov.ws +# /a +# +# PUBLIC NOTICE ON DAYLIGHT SAVING TIME +# +# Pursuant to the Daylight Saving Act 2009 and Cabinets decision, +# businesses and the general public are hereby advised that daylight +# saving time is on the first Saturday of April 2011 (02/04/11). +# +# The public is therefore advised that when the standard time strikes +# the hour of four oclock (4.00am or 0400 Hours) on the 2nd April 2011, +# then all instruments used to measure standard time are to be +# adjusted/changed to three oclock (3:00am or 0300Hrs). +# +# Margaret Fruean ACTING CHIEF EXECUTIVE OFFICER MINISTRY OF COMMERCE, +# INDUSTRY AND LABOUR 28th February 2011 + Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5 -11:26:56 - LMT 1911 -11:30 - SAMT1950# Samoa Time -11:00 - WST 2010 Sep 26 - -11:00 1:00WSDT2011 Apr 3 1:00 + -11:00 1:00WSDT2011 Apr 2 4:00 -11:00 - WST # Solomon Is Modified: stable/6/share/zoneinfo/etcetera == --- stable/6/share/zoneinfo/etceteraWed Mar 16 03:34:41 2011 (r219689) +++ stable/6/share/zoneinfo/etceteraWed Mar 16 03:35:12 2011 (r219690) @@ -1,5 +1,5 @@ # pre -# @(#)etcetera 8.2 +# @(#)etcetera 8.3 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -36,8 +36,7 @@ Link Etc/GMT Etc/GMT0 # (i.e. west of Greenwich) even though many people would expect it to # mean 4 hours ahead of UTC (i.e. east of Greenwich). # -# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation -# (which is not yet supported by the tz code) allows for +# In the draft 5 of POSIX 1003.1-200x, the angle bracket notation allows for # TZ='GMT-4+4'; if you want time zone abbreviations conforming to # ISO 8601 you can use TZ='-0400+4'. Thus the commonly-expected # offset is kept within the angle bracket (and is used for display) Modified: stable/6/share/zoneinfo/europe == --- stable/6/share/zoneinfo/europe Wed Mar 16 03:34:41 2011 (r219689) +++ stable/6/share/zoneinfo/europe Wed Mar 16 03:35:12 2011 (r219690) @@ -1,5 +1,5 @@ # pre -# @(#)europe 8.27 +# @(#)europe 8.28 # This file is in the public domain, so clarified as of # 2009-05-17 by Arthur David Olson. @@ -2483,25 +2483,18 @@ ZoneEurope/Zurich 0:34:08 - LMT 1848 Se # (on a non-government server though) describing dates between 2002 and 2006: # http://www.alomaliye.com/bkk_2002_3769.htm -# From Sue Williams (2008-08-11): -# I spotted this news article about a potential change in Turkey. -# -# a href=http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1; -# http://www.hurriyet.com.tr/english/domestic/9626174.asp?scr=1 +# From Gouml;kdeniz Karada#x011f; (2011-03-10): +# +# According to the articles linked below, Turkey will change into summer +# time zone (GMT+3) on March 28, 2011 at 3:00 a.m. instead of March 27. +# This change is due to a nationwide exam on 27th. +# +# a href=http://www.worldbulletin.net/?aType=haberArticleID=70872; +# http://www.worldbulletin.net/?aType=haberArticleID=70872 # /a - -# From Sue Williams (2008-08-20): -# This article says that around the end of March 2011, Turkey wants to -# adjust the clocks forward by 1/2 hour and stay that way
svn commit: r219691 - in head/sys: boot/common boot/efi/libefi boot/ia64/common boot/ia64/efi boot/ia64/ski ia64/include
Author: marcel Date: Wed Mar 16 03:53:18 2011 New Revision: 219691 URL: http://svn.freebsd.org/changeset/base/219691 Log: MFaltix: Add support for Pre-Boot Virtual Memory (PBVM) to the loader. PBVM allows us to link the kernel at a fixed virtual address without having to make any assumptions about the physical memory layout. On the SGI Altix 350 for example, there's no usuable physical memory below 192GB. Also, the PBVM allows us to control better where we're going to physically load the kernel and its modules so that we can make sure we load the kernel in memory that's close to the BSP. The PBVM is managed by a simple page table. The minimum size of the page table is 4KB (EFI page size) and the maximum is currently set to 1MB. A page in the PBVM is 64KB, as that's the maximum alignment one can specify in a linker script. The bottom line is that PBVM is between 64KB and 8GB in size. The loader maps the PBVM page table at a fixed virtual address and using a single translations. The PBVM itself is also mapped using a single translation for a maximum of 32MB. While here, increase the heap in the EFI loader from 512KB to 2MB and set the stage for supporting relocatable modules. Modified: head/sys/boot/common/Makefile.inc head/sys/boot/efi/libefi/libefi.c head/sys/boot/ia64/common/bootinfo.c head/sys/boot/ia64/common/copy.c head/sys/boot/ia64/common/exec.c head/sys/boot/ia64/common/libia64.h head/sys/boot/ia64/efi/conf.c head/sys/boot/ia64/efi/efimd.c head/sys/boot/ia64/efi/version head/sys/boot/ia64/ski/conf.c head/sys/boot/ia64/ski/libski.h head/sys/boot/ia64/ski/skimd.c head/sys/boot/ia64/ski/version head/sys/ia64/include/bootinfo.h head/sys/ia64/include/vmparam.h Directory Properties: head/sys/boot/ (props changed) head/sys/boot/ia64/efi/ (props changed) head/sys/boot/ia64/ski/ (props changed) head/sys/boot/powerpc/boot1.chrp/ (props changed) head/sys/boot/powerpc/ofw/ (props changed) Modified: head/sys/boot/common/Makefile.inc == --- head/sys/boot/common/Makefile.inc Wed Mar 16 03:35:12 2011 (r219690) +++ head/sys/boot/common/Makefile.inc Wed Mar 16 03:53:18 2011 (r219691) @@ -7,6 +7,8 @@ SRCS+= module.c panic.c .if ${MACHINE} == i386 || ${MACHINE_CPUARCH} == amd64 SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c +.elif ${MACHINE_CPUARCH} == ia64 +SRCS+= load_elf64.c load_elf64_obj.c reloc_elf64.c .elif ${MACHINE} == pc98 SRCS+= load_elf32.c load_elf32_obj.c reloc_elf32.c .elif ${MACHINE_CPUARCH} == arm @@ -14,7 +16,7 @@ SRCS+=load_elf32.c reloc_elf32.c .elif ${MACHINE_CPUARCH} == powerpc SRCS+= load_elf32.c reloc_elf32.c SRCS+= load_elf64.c reloc_elf64.c -.elif ${MACHINE_CPUARCH} == sparc64 || ${MACHINE_CPUARCH} == ia64 +.elif ${MACHINE_CPUARCH} == sparc64 SRCS+= load_elf64.c reloc_elf64.c .endif Modified: head/sys/boot/efi/libefi/libefi.c == --- head/sys/boot/efi/libefi/libefi.c Wed Mar 16 03:35:12 2011 (r219690) +++ head/sys/boot/efi/libefi/libefi.c Wed Mar 16 03:53:18 2011 (r219691) @@ -92,7 +92,7 @@ efi_main(EFI_HANDLE image_handle, EFI_SY BS = ST-BootServices; RS = ST-RuntimeServices; - heapsize = 512*1024; + heapsize = 2 * 1024 * 1024; status = BS-AllocatePages(AllocateAnyPages, EfiLoaderData, EFI_SIZE_TO_PAGES(heapsize), heap); if (status != EFI_SUCCESS) Modified: head/sys/boot/ia64/common/bootinfo.c == --- head/sys/boot/ia64/common/bootinfo.cWed Mar 16 03:35:12 2011 (r219690) +++ head/sys/boot/ia64/common/bootinfo.cWed Mar 16 03:53:18 2011 (r219691) @@ -226,7 +226,7 @@ bi_copymodules(vm_offset_t addr) * - Module metadata are formatted and placed in kernel space. */ int -bi_load(struct preloaded_file *fp, uint64_t *bi_addr) +ia64_bootinfo(struct preloaded_file *fp, struct bootinfo **res) { struct bootinfo bi; struct preloaded_file *xp; @@ -234,7 +234,9 @@ bi_load(struct preloaded_file *fp, uint6 struct devdesc *rootdev; char *rootdevname; vm_offset_t addr, ssym, esym; + int error; + *res = NULL; bzero(bi, sizeof(struct bootinfo)); bi.bi_magic = BOOTINFO_MAGIC; bi.bi_version = 1; @@ -289,8 +291,28 @@ bi_load(struct preloaded_file *fp, uint6 bi.bi_envp = 0; } - addr = (addr + PAGE_MASK) ~PAGE_MASK; + addr = (addr + 15) ~15; bi.bi_kernend = addr; - return (ldr_bootinfo(bi, bi_addr)); + error = ia64_platform_bootinfo(bi, res); + if (error) + return (error); + + if (IS_LEGACY_KERNEL()) { + if
Re: svn commit: r219676 - head/sys/x86/x86
On Tue, 15 Mar 2011, Jung-uk Kim wrote: On Tuesday 15 March 2011 05:01 pm, John Baldwin wrote: On Tuesday, March 15, 2011 3:47:20 pm Jung-uk Kim wrote: Author: jkim Date: Tue Mar 15 19:47:20 2011 New Revision: 219676 URL: http://svn.freebsd.org/changeset/base/219676 Log: Do not let machdep.tsc_freq modify tsc_freq itself. It is bad for i386 as it does not operate atomically. Actually, it serves no purpose. Noticed by: bde Ouch, please revert! We have depended on this for testing to workaround BIOS issues (e.g. the USB SMI# handler firing at a bad time during boot causing the TSC frequency to be calculated incorrectly). I agree it's a hack that this works, but it has actually proven useful in the past. Please revert. I use this for setting timecounters from userland. The sysctl is not a hack, but the primary user interface for managing the TSC frequency. The kern.timecounter.tc.TSC.frequency sysctl is secondary, and is readonly anyway, so it cannot be used to manage the TSC frequency or even the timecounter frequency. You can still change timecounter frequency. Can you please explain why you need to change tsc_freq directly? 1. All my scripts change tsc_freq directly. They are portable to systems that don't have kern.timecounter.tc.TSC.frequency or even timecounters. Even for systems that have kern.timecounter.tc.TSC.frequency, the scripts would need messes to use this sysctl to read the TSC frequency and the old sysctl to write the timecounter frequency, since the tsc_freq variable can no longer be changed using its own sysctl and the TSC's TSC's timecounter current frequency can no longer be seen using the TSC's sysctl. 2. tsc_freq is used by other subsystems and it doesn't hurt for it to be as accurate as possible: - cputicker - high resolution kernel profiling These are relatively unimportant since you errors of 1 part per million don't really matter and high resolution kernel profiling is broken. The change doesn't even fix races accessing frequency variables. They are still there when the local variable is copied to the timecounter frequency. Timecounter code divides by tc_frequency, so this race is more serious than in most places (other places tend not to use the TSC when tsc_freq is transiently 0 due to the races). The divisions are in: - tc_init - tc_windup. This is called from a fast interrupt handler with nothing but time-domain locking which doesn't help here. - pps_event. This can also be called from a fast interrupt handler. Locking of ntptime's variables is also broken by calling tc_windup and pps_event from fast interrupt handlers. kern_ntptime.c still says that all its routines must run at splclock or higher. But splclock has decayed to null. Some of ntptimes routines are locked by Giant. This is impossible starting in a fast interrupt handler, so tc_windup and pps_event just call up to ntptime (ntp_update_second() and hardpps()) with no locking whatsoever. Bruce ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219672 - in head: share/man/man9 sys/i386/include
On Tue, 15 Mar 2011, Jung-uk Kim wrote: On Tuesday 15 March 2011 03:55 pm, Jung-uk Kim wrote: On Tuesday 15 March 2011 03:33 pm, Maxim Dounin wrote: Hello! On Tue, Mar 15, 2011 at 05:14:26PM +, Jung-uk Kim wrote: Author: jkim Date: Tue Mar 15 17:14:26 2011 New Revision: 219672 URL: http://svn.freebsd.org/changeset/base/219672 Log: Unconditionally use binuptime(9) for get_cyclecount(9) on i386. Since this function is almost exclusively used for random harvesting, there is no need for micro-optimization. Adjust the manual page accordingly. Note that on early boot only dummy timecounter available, and binuptime() has no entropy. As a result of this change random(9) won't have entropy on early boot on i386, and arc4random(9) as well. While there are no known major security problems associated with it - it at least makes stack protector easily bypasseable as it now (again after r198295) uses well-known stack guard instead of random one. And there may be other issues as well. Is dummy timecounter used for long enough to matter? I think completion of clock initialization is still bogusly late for histrotical reasons, but there is still a second or two between completion of timecounter initialization and user mode. The earlier stages of booting might take 20 seconds but should be faster, so they might not provided much more entropy from clocks. I have entropy stuff mostly turned off and often don't even have enough entropy to run ed on /etc/fstab early. Don't know if I have clock entropy turned off. Hope you thought well before moving i386 to a set of platforms which have no early boot randomness at all. And you have good reason for doing it. I asked for moving all platforms to binuptime() so that the bugs could be seen by everyone :-). Didn't know about this bug. Hmm... Is bintime(9) good enough for you then? I guess it won't work cause boottimebin is set pretty late. Arg... If I can't come up with something sensible, I'll revert this commit. boottimebin would make no difference since it just provides provides a few non-random bits. Bruce ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
Re: svn commit: r219679 - head/sys/i386/include
On Wed, 16 Mar 2011, Maxim Dounin wrote: On Tue, Mar 15, 2011 at 09:45:10PM +, Jung-uk Kim wrote: Author: jkim Date: Tue Mar 15 21:45:10 2011 New Revision: 219679 URL: http://svn.freebsd.org/changeset/base/219679 Log: Partially revert r219672. After r198295, kernel need to seed randomness as ... Modified: head/sys/i386/include/cpu.h == --- head/sys/i386/include/cpu.h Tue Mar 15 21:34:10 2011(r219678) +++ head/sys/i386/include/cpu.h Tue Mar 15 21:45:10 2011(r219679) @@ -69,10 +69,14 @@ voidswi_vm(void *); static __inline uint64_t get_cyclecount(void) { +#if defined(I486_CPU) || defined(KLD_MODULE) struct bintime bt; binuptime(bt); return ((uint64_t)bt.sec 56 | bt.frac 8); +#else + return (rdtsc()); +#endif This isn't really different as long as GENERIC kernel used, as GENERIC defines I486_CPU. Also, the KLD_MODULE case is broken. This restores the ifdefs but not the tsc_present check in the old version. The ifdefs are not sort of necessary, but they seem to have been bogus in the old version. Just checking a runtime variable like tsc_present would have worked provided the variable existed. tsc.c is standard so the variable existed even if I486_CPU or KLD_MODULE was defined. I think TSC support was standard even when get_cyclecount() was first committed and had an I386_CPU ifdef, so the ifdef was always bogus. The ifdef gave a micro-optimization in some cases, but it was a very tiny one (avoid a perfectly predictable branch). Bruce ___ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org