From owner-svn-src-projects@FreeBSD.ORG Mon Apr 4 03:41:19 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AD0BA106564A; Mon, 4 Apr 2011 03:41:19 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 908168FC14; Mon, 4 Apr 2011 03:41:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p343fJGp069808; Mon, 4 Apr 2011 03:41:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p343fJwP069787; Mon, 4 Apr 2011 03:41:19 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201104040341.p343fJwP069787@svn.freebsd.org> From: Marcel Moolenaar Date: Mon, 4 Apr 2011 03:41:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220315 - in projects/altix/sys: amd64/conf amd64/ia32 amd64/linux32 arm/conf arm/econa boot/common boot/ia64/common boot/ia64/efi boot/ia64/ski boot/pc98/loader boot/sparc64/loader com... X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 Apr 2011 03:41:19 -0000 Author: marcel Date: Mon Apr 4 03:41:18 2011 New Revision: 220315 URL: http://svn.freebsd.org/changeset/base/220315 Log: Merge svn+ssh://svn.freebsd.org/base/head@220314 Added: projects/altix/sys/dev/ath/if_ath_ahb.c - copied unchanged from r220314, head/sys/dev/ath/if_ath_ahb.c projects/altix/sys/dev/nvram2env/ - copied from r220314, head/sys/dev/nvram2env/ projects/altix/sys/kern/kern_racct.c - copied unchanged from r220314, head/sys/kern/kern_racct.c projects/altix/sys/kern/kern_rctl.c - copied unchanged from r220314, head/sys/kern/kern_rctl.c projects/altix/sys/mips/conf/AR91XX_BASE - copied unchanged from r220314, head/sys/mips/conf/AR91XX_BASE projects/altix/sys/mips/conf/AR91XX_BASE.hints - copied unchanged from r220314, head/sys/mips/conf/AR91XX_BASE.hints projects/altix/sys/mips/conf/RT305X - copied unchanged from r220314, head/sys/mips/conf/RT305X projects/altix/sys/mips/conf/RT305X.hints - copied unchanged from r220314, head/sys/mips/conf/RT305X.hints projects/altix/sys/mips/conf/TP-WN1043ND - copied unchanged from r220314, head/sys/mips/conf/TP-WN1043ND projects/altix/sys/mips/conf/TP-WN1043ND.hints - copied unchanged from r220314, head/sys/mips/conf/TP-WN1043ND.hints projects/altix/sys/mips/rt305x/ - copied from r220314, head/sys/mips/rt305x/ projects/altix/sys/modules/ath_ahb/ - copied from r220314, head/sys/modules/ath_ahb/ projects/altix/sys/modules/ath_pci/ - copied from r220314, head/sys/modules/ath_pci/ projects/altix/sys/modules/cxgbe/if_cxgbe/ - copied from r220314, head/sys/modules/cxgbe/if_cxgbe/ projects/altix/sys/sys/racct.h - copied unchanged from r220314, head/sys/sys/racct.h projects/altix/sys/sys/rctl.h - copied unchanged from r220314, head/sys/sys/rctl.h Replaced: projects/altix/sys/modules/cxgbe/Makefile - copied unchanged from r220314, head/sys/modules/cxgbe/Makefile Modified: projects/altix/sys/amd64/conf/GENERIC projects/altix/sys/amd64/ia32/ia32_misc.c projects/altix/sys/amd64/ia32/ia32_signal.c projects/altix/sys/amd64/ia32/ia32_sigtramp.S projects/altix/sys/amd64/ia32/ia32_syscall.c projects/altix/sys/amd64/linux32/linux.h projects/altix/sys/arm/conf/AVILA projects/altix/sys/arm/conf/CAMBRIA projects/altix/sys/arm/econa/ehci_ebus.c projects/altix/sys/boot/common/bootstrap.h projects/altix/sys/boot/common/load_elf.c projects/altix/sys/boot/common/load_elf_obj.c projects/altix/sys/boot/common/module.c projects/altix/sys/boot/ia64/common/copy.c projects/altix/sys/boot/ia64/common/exec.c projects/altix/sys/boot/ia64/common/libia64.h projects/altix/sys/boot/ia64/efi/main.c projects/altix/sys/boot/ia64/ski/efi_stub.c projects/altix/sys/boot/ia64/ski/main.c projects/altix/sys/boot/ia64/ski/skimd.c projects/altix/sys/boot/pc98/loader/main.c projects/altix/sys/boot/sparc64/loader/main.c projects/altix/sys/compat/freebsd32/freebsd32.h projects/altix/sys/compat/freebsd32/freebsd32_ioctl.c projects/altix/sys/compat/freebsd32/freebsd32_ioctl.h projects/altix/sys/compat/freebsd32/freebsd32_misc.c projects/altix/sys/compat/freebsd32/freebsd32_proto.h projects/altix/sys/compat/freebsd32/freebsd32_syscall.h projects/altix/sys/compat/freebsd32/freebsd32_syscalls.c projects/altix/sys/compat/freebsd32/freebsd32_sysent.c projects/altix/sys/compat/freebsd32/freebsd32_systrace_args.c projects/altix/sys/compat/freebsd32/syscalls.master projects/altix/sys/compat/ia32/ia32_genassym.c projects/altix/sys/compat/ia32/ia32_signal.h projects/altix/sys/compat/ia32/ia32_sysvec.c projects/altix/sys/compat/ia32/ia32_util.h projects/altix/sys/compat/linux/linux_socket.c projects/altix/sys/conf/NOTES projects/altix/sys/conf/files projects/altix/sys/conf/files.mips projects/altix/sys/conf/options projects/altix/sys/dev/age/if_age.c projects/altix/sys/dev/ath/ath_hal/ah.c projects/altix/sys/dev/ath/ath_hal/ah_internal.h projects/altix/sys/dev/ath/ath_hal/ar5416/ar2133.c projects/altix/sys/dev/ath/ath_hal/ar5416/ar5416.h projects/altix/sys/dev/ath/ath_hal/ar5416/ar5416_interrupts.c projects/altix/sys/dev/ath/ath_hal/ar5416/ar5416_recv.c projects/altix/sys/dev/ath/ath_hal/ar5416/ar5416_reset.c projects/altix/sys/dev/ath/ath_hal/ar9001/ar9160.ini projects/altix/sys/dev/ath/if_ath.c projects/altix/sys/dev/ath/if_ath_pci.c projects/altix/sys/dev/ath/if_ath_sysctl.c projects/altix/sys/dev/ath/if_athioctl.h projects/altix/sys/dev/bxe/if_bxe.c projects/altix/sys/dev/bxe/if_bxe.h projects/altix/sys/dev/cxgbe/common/common.h projects/altix/sys/dev/cxgbe/common/t4fw_interface.h projects/altix/sys/dev/cxgbe/t4_main.c projects/altix/sys/dev/e1000/if_em.c projects/altix/sys/dev/e1000/if_em.h projects/altix/sys/dev/pci/pci.c projects/altix/sys/dev/pci/pci_user.c projects/altix/sys/dev/pci/pcireg.h projects/altix/sys/dev/pci/pcivar.h projects/altix/sys/dev/streams/streams.c projects/altix/sys/dev/usb/controller/ehci_ixp4xx.c projects/altix/sys/dev/usb/controller/ehci_mv.c projects/altix/sys/dev/usb/controller/ehci_pci.c projects/altix/sys/dev/usb/usb_generic.c projects/altix/sys/dev/usb/usb_pf.c projects/altix/sys/dev/usb/usb_pf.h projects/altix/sys/dev/usb/usb_transfer.c projects/altix/sys/dev/usb/usbdi.h projects/altix/sys/dev/usb/wlan/if_run.c projects/altix/sys/fs/nfsclient/nfs_clcomsubs.c projects/altix/sys/fs/nfsclient/nfs_clrpcops.c projects/altix/sys/geom/eli/g_eli.c projects/altix/sys/geom/gate/g_gate.c projects/altix/sys/geom/nop/g_nop.c projects/altix/sys/geom/raid/g_raid.c projects/altix/sys/geom/raid/md_intel.c projects/altix/sys/geom/raid/md_jmicron.c projects/altix/sys/geom/raid/md_nvidia.c projects/altix/sys/geom/raid/md_promise.c projects/altix/sys/geom/raid/md_sii.c projects/altix/sys/geom/raid/tr_raid1.c projects/altix/sys/geom/raid/tr_raid1e.c projects/altix/sys/i386/conf/GENERIC projects/altix/sys/i386/conf/PAE projects/altix/sys/i386/linux/linux.h projects/altix/sys/ia64/ia32/ia32_misc.c projects/altix/sys/ia64/ia32/ia32_signal.c projects/altix/sys/ia64/include/bootinfo.h projects/altix/sys/isa/pnp.c projects/altix/sys/kern/imgact_aout.c projects/altix/sys/kern/init_main.c projects/altix/sys/kern/init_sysent.c projects/altix/sys/kern/kern_descrip.c projects/altix/sys/kern/kern_event.c projects/altix/sys/kern/kern_exit.c projects/altix/sys/kern/kern_fork.c projects/altix/sys/kern/kern_jail.c projects/altix/sys/kern/kern_linker.c projects/altix/sys/kern/kern_loginclass.c projects/altix/sys/kern/kern_prot.c projects/altix/sys/kern/kern_resource.c projects/altix/sys/kern/kern_thr.c projects/altix/sys/kern/sched_4bsd.c projects/altix/sys/kern/sched_ule.c projects/altix/sys/kern/sys_pipe.c projects/altix/sys/kern/syscalls.c projects/altix/sys/kern/syscalls.master projects/altix/sys/kern/systrace_args.c projects/altix/sys/kern/tty_pts.c projects/altix/sys/kern/uipc_mqueue.c projects/altix/sys/kern/uipc_sem.c projects/altix/sys/kern/uipc_shm.c projects/altix/sys/kern/uipc_syscalls.c projects/altix/sys/kern/vfs_syscalls.c projects/altix/sys/mips/atheros/ar71xx_ehci.c projects/altix/sys/mips/atheros/ar724x_chip.c projects/altix/sys/mips/atheros/ar724xreg.h projects/altix/sys/mips/atheros/if_arge.c projects/altix/sys/mips/conf/AR71XX projects/altix/sys/mips/conf/IDT projects/altix/sys/mips/conf/OCTEON1 projects/altix/sys/mips/conf/SENTRY5 projects/altix/sys/mips/rmi/xls_ehci.c projects/altix/sys/modules/Makefile projects/altix/sys/modules/ath/Makefile projects/altix/sys/modules/ipfw/Makefile projects/altix/sys/netinet/ipfw/ip_dn_glue.c projects/altix/sys/netinet/ipfw/ip_dummynet.c projects/altix/sys/netinet/ipfw/ip_fw2.c projects/altix/sys/netinet/tcp_input.c projects/altix/sys/netipsec/ipsec.h projects/altix/sys/netipsec/ipsec_output.c projects/altix/sys/netipsec/key.c projects/altix/sys/netipsec/key.h projects/altix/sys/netipsec/xform.h projects/altix/sys/netipsec/xform_ah.c projects/altix/sys/netipsec/xform_esp.c projects/altix/sys/netipsec/xform_ipcomp.c projects/altix/sys/opencrypto/cryptodev.c projects/altix/sys/pc98/conf/GENERIC projects/altix/sys/sparc64/conf/GENERIC projects/altix/sys/sparc64/pci/psycho.c projects/altix/sys/sparc64/pci/psychovar.h projects/altix/sys/sys/filedesc.h projects/altix/sys/sys/jail.h projects/altix/sys/sys/kernel.h projects/altix/sys/sys/loginclass.h projects/altix/sys/sys/param.h projects/altix/sys/sys/priv.h projects/altix/sys/sys/proc.h projects/altix/sys/sys/resourcevar.h projects/altix/sys/sys/syscall.h projects/altix/sys/sys/syscall.mk projects/altix/sys/sys/syscallsubr.h projects/altix/sys/sys/sysproto.h projects/altix/sys/tools/fw_stub.awk projects/altix/sys/ufs/ffs/ffs_softdep.c Directory Properties: projects/altix/lib/libstand/ (props changed) projects/altix/sys/ (props changed) projects/altix/sys/amd64/include/xen/ (props changed) projects/altix/sys/boot/i386/efi/ (props changed) projects/altix/sys/boot/ia64/efi/ (props changed) projects/altix/sys/boot/ia64/ski/ (props changed) projects/altix/sys/boot/powerpc/boot1.chrp/ (props changed) projects/altix/sys/boot/powerpc/ofw/ (props changed) projects/altix/sys/cddl/contrib/opensolaris/ (props changed) projects/altix/sys/conf/ (props changed) projects/altix/sys/contrib/dev/acpica/ (props changed) projects/altix/sys/contrib/octeon-sdk/ (props changed) projects/altix/sys/contrib/pf/ (props changed) projects/altix/sys/contrib/x86emu/ (props changed) projects/altix/sys/kern/subr_busdma.c (props changed) Modified: projects/altix/sys/amd64/conf/GENERIC ============================================================================== --- projects/altix/sys/amd64/conf/GENERIC Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/amd64/conf/GENERIC Mon Apr 4 03:41:18 2011 (r220315) @@ -257,7 +257,8 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_amrr # AMRR transmit rate control algorithm device an # Aironet 4500/4800 802.11 wireless NICs. -device ath # Atheros pci/cardbus NIC's +device ath # Atheros NIC's +device ath_pci # Atheros pci/cardbus glue device ath_hal # pci/cardbus chip support options AH_SUPPORT_AR5416 # enable AR5416 tx/rx descriptors device ath_rate_sample # SampleRate tx rate control for ath Modified: projects/altix/sys/amd64/ia32/ia32_misc.c ============================================================================== --- projects/altix/sys/amd64/ia32/ia32_misc.c Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/amd64/ia32/ia32_misc.c Mon Apr 4 03:41:18 2011 (r220315) @@ -69,3 +69,14 @@ freebsd32_sysarch(struct thread *td, str return (sysarch(td, &uap1)); } } + +#ifdef COMPAT_43 +int +ofreebsd32_getpagesize(struct thread *td, + struct ofreebsd32_getpagesize_args *uap) +{ + + td->td_retval[0] = IA32_PAGE_SIZE; + return (0); +} +#endif Modified: projects/altix/sys/amd64/ia32/ia32_signal.c ============================================================================== --- projects/altix/sys/amd64/ia32/ia32_signal.c Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/amd64/ia32/ia32_signal.c Mon Apr 4 03:41:18 2011 (r220315) @@ -300,6 +300,109 @@ freebsd32_swapcontext(struct thread *td, * frame pointer, it returns to the user * specified pc, psl. */ + +#ifdef COMPAT_43 +static void +ia32_osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) +{ + struct ia32_sigframe3 sf, *fp; + struct proc *p; + struct thread *td; + struct sigacts *psp; + struct trapframe *regs; + int sig; + int oonstack; + + td = curthread; + p = td->td_proc; + PROC_LOCK_ASSERT(p, MA_OWNED); + sig = ksi->ksi_signo; + psp = p->p_sigacts; + mtx_assert(&psp->ps_mtx, MA_OWNED); + regs = td->td_frame; + oonstack = sigonstack(regs->tf_rsp); + + /* Allocate space for the signal handler context. */ + if ((td->td_pflags & TDP_ALTSTACK) && !oonstack && + SIGISMEMBER(psp->ps_sigonstack, sig)) { + fp = (struct ia32_sigframe3 *)(td->td_sigstk.ss_sp + + td->td_sigstk.ss_size - sizeof(sf)); + td->td_sigstk.ss_flags |= SS_ONSTACK; + } else + fp = (struct ia32_sigframe3 *)regs->tf_rsp - 1; + + /* Translate the signal if appropriate. */ + if (p->p_sysent->sv_sigtbl && sig <= p->p_sysent->sv_sigsize) + sig = p->p_sysent->sv_sigtbl[_SIG_IDX(sig)]; + + /* Build the argument list for the signal handler. */ + sf.sf_signum = sig; + sf.sf_scp = (register_t)&fp->sf_siginfo.si_sc; + if (SIGISMEMBER(psp->ps_siginfo, sig)) { + /* Signal handler installed with SA_SIGINFO. */ + sf.sf_arg2 = (register_t)&fp->sf_siginfo; + sf.sf_siginfo.si_signo = sig; + sf.sf_siginfo.si_code = ksi->ksi_code; + sf.sf_ah = (uintptr_t)catcher; + } else { + /* Old FreeBSD-style arguments. */ + sf.sf_arg2 = ksi->ksi_code; + sf.sf_addr = (register_t)ksi->ksi_addr; + sf.sf_ah = (uintptr_t)catcher; + } + mtx_unlock(&psp->ps_mtx); + PROC_UNLOCK(p); + + /* Save most if not all of trap frame. */ + sf.sf_siginfo.si_sc.sc_eax = regs->tf_rax; + sf.sf_siginfo.si_sc.sc_ebx = regs->tf_rbx; + sf.sf_siginfo.si_sc.sc_ecx = regs->tf_rcx; + sf.sf_siginfo.si_sc.sc_edx = regs->tf_rdx; + sf.sf_siginfo.si_sc.sc_esi = regs->tf_rsi; + sf.sf_siginfo.si_sc.sc_edi = regs->tf_rdi; + sf.sf_siginfo.si_sc.sc_cs = regs->tf_cs; + sf.sf_siginfo.si_sc.sc_ds = regs->tf_ds; + sf.sf_siginfo.si_sc.sc_ss = regs->tf_ss; + sf.sf_siginfo.si_sc.sc_es = regs->tf_es; + sf.sf_siginfo.si_sc.sc_fs = regs->tf_fs; + sf.sf_siginfo.si_sc.sc_gs = regs->tf_gs; + sf.sf_siginfo.si_sc.sc_isp = regs->tf_rsp; + + /* Build the signal context to be used by osigreturn(). */ + sf.sf_siginfo.si_sc.sc_onstack = (oonstack) ? 1 : 0; + SIG2OSIG(*mask, sf.sf_siginfo.si_sc.sc_mask); + sf.sf_siginfo.si_sc.sc_esp = regs->tf_rsp; + sf.sf_siginfo.si_sc.sc_ebp = regs->tf_rbp; + sf.sf_siginfo.si_sc.sc_eip = regs->tf_rip; + sf.sf_siginfo.si_sc.sc_eflags = regs->tf_rflags; + sf.sf_siginfo.si_sc.sc_trapno = regs->tf_trapno; + sf.sf_siginfo.si_sc.sc_err = regs->tf_err; + + /* + * Copy the sigframe out to the user's stack. + */ + if (copyout(&sf, fp, sizeof(*fp)) != 0) { +#ifdef DEBUG + printf("process %ld has trashed its stack\n", (long)p->p_pid); +#endif + PROC_LOCK(p); + sigexit(td, SIGILL); + } + + regs->tf_rsp = (uintptr_t)fp; + regs->tf_rip = p->p_sysent->sv_psstrings - sz_ia32_osigcode; + regs->tf_rflags &= ~(PSL_T | PSL_D); + regs->tf_cs = _ucode32sel; + regs->tf_ds = _udatasel; + regs->tf_es = _udatasel; + regs->tf_fs = _udatasel; + regs->tf_ss = _udatasel; + set_pcb_flags(td->td_pcb, PCB_FULL_IRET); + PROC_LOCK(p); + mtx_lock(&psp->ps_mtx); +} +#endif + #ifdef COMPAT_FREEBSD4 static void freebsd4_ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) @@ -441,6 +544,12 @@ ia32_sendsig(sig_t catcher, ksiginfo_t * return; } #endif +#ifdef COMPAT_43 + if (SIGISMEMBER(psp->ps_osigset, sig)) { + ia32_osendsig(catcher, ksi, mask); + return; + } +#endif mtx_assert(&psp->ps_mtx, MA_OWNED); regs = td->td_frame; oonstack = sigonstack(regs->tf_rsp); @@ -547,6 +656,64 @@ ia32_sendsig(sig_t catcher, ksiginfo_t * * make sure that the user has not modified the * state to gain improper privileges. */ + +#ifdef COMPAT_43 +int +ofreebsd32_sigreturn(struct thread *td, struct ofreebsd32_sigreturn_args *uap) +{ + struct ia32_sigcontext3 sc, *scp; + struct trapframe *regs; + int eflags, error; + ksiginfo_t ksi; + + regs = td->td_frame; + error = copyin(uap->sigcntxp, &sc, sizeof(sc)); + if (error != 0) + return (error); + scp = ≻ + eflags = scp->sc_eflags; + if (!EFL_SECURE(eflags & ~PSL_RF, regs->tf_rflags & ~PSL_RF)) { + return (EINVAL); + } + if (!CS_SECURE(scp->sc_cs)) { + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGBUS; + ksi.ksi_code = BUS_OBJERR; + ksi.ksi_trapno = T_PROTFLT; + ksi.ksi_addr = (void *)regs->tf_rip; + trapsignal(td, &ksi); + return (EINVAL); + } + regs->tf_ds = scp->sc_ds; + regs->tf_es = scp->sc_es; + regs->tf_fs = scp->sc_fs; + regs->tf_gs = scp->sc_gs; + + regs->tf_rax = scp->sc_eax; + regs->tf_rbx = scp->sc_ebx; + regs->tf_rcx = scp->sc_ecx; + regs->tf_rdx = scp->sc_edx; + regs->tf_rsi = scp->sc_esi; + regs->tf_rdi = scp->sc_edi; + regs->tf_cs = scp->sc_cs; + regs->tf_ss = scp->sc_ss; + regs->tf_rbp = scp->sc_ebp; + regs->tf_rsp = scp->sc_esp; + regs->tf_rip = scp->sc_eip; + regs->tf_rflags = eflags; + + if (scp->sc_onstack & 1) + td->td_sigstk.ss_flags |= SS_ONSTACK; + else + td->td_sigstk.ss_flags &= ~SS_ONSTACK; + + kern_sigprocmask(td, SIG_SETMASK, (sigset_t *)&scp->sc_mask, NULL, + SIGPROCMASK_OLD); + set_pcb_flags(td->td_pcb, PCB_FULL_IRET); + return (EJUSTRETURN); +} +#endif + #ifdef COMPAT_FREEBSD4 /* * MPSAFE @@ -734,6 +901,9 @@ ia32_setregs(struct thread *td, struct i user_ldt_free(td); else mtx_unlock(&dt_lock); +#ifdef COMPAT_43 + setup_lcall_gate(); +#endif pcb->pcb_fsbase = 0; pcb->pcb_gsbase = 0; Modified: projects/altix/sys/amd64/ia32/ia32_sigtramp.S ============================================================================== --- projects/altix/sys/amd64/ia32/ia32_sigtramp.S Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/amd64/ia32/ia32_sigtramp.S Mon Apr 4 03:41:18 2011 (r220315) @@ -66,6 +66,35 @@ freebsd4_ia32_sigcode: jmp 1b #endif +#ifdef COMPAT_43 + ALIGN_TEXT +ia32_osigcode: + calll *IA32_SIGF_HANDLER(%esp)/* call signal handler */ + leal IA32_SIGF_SC(%esp),%eax /* get sigcontext */ + pushl %eax + movl $103,%eax /* 3.x SYS_sigreturn */ + pushl %eax /* junk to fake return addr. */ + int $0x80 /* enter kernel with args */ +1: + jmp 1b + + + ALIGN_TEXT +lcall_tramp: + pushl %ebp + movl %esp,%ebp + pushl 0x24(%ebp) /* arg 6 */ + pushl 0x20(%ebp) + pushl 0x1c(%ebp) + pushl 0x18(%ebp) + pushl 0x14(%ebp) + pushl 0x10(%ebp) /* arg 1 */ + pushl 0xc(%ebp) /* gap */ + int $0x80 + leave + lretl +#endif + ALIGN_TEXT esigcode: @@ -78,3 +107,11 @@ sz_ia32_sigcode: sz_freebsd4_ia32_sigcode: .long esigcode-freebsd4_ia32_sigcode #endif +#ifdef COMPAT_43 + .globl sz_ia32_osigcode +sz_ia32_osigcode: + .long esigcode-ia32_osigcode + .globl sz_lcall_tramp +sz_lcall_tramp: + .long esigcode-lcall_tramp +#endif Modified: projects/altix/sys/amd64/ia32/ia32_syscall.c ============================================================================== --- projects/altix/sys/amd64/ia32/ia32_syscall.c Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/amd64/ia32/ia32_syscall.c Mon Apr 4 03:41:18 2011 (r220315) @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD$"); */ #include "opt_clock.h" +#include "opt_compat.h" #include "opt_cpu.h" #include "opt_isa.h" @@ -78,7 +79,17 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define IDTVEC(name) __CONCAT(X,name) @@ -198,3 +209,45 @@ ia32_syscall_disable(void *dummy) SYSINIT(ia32_syscall, SI_SUB_EXEC, SI_ORDER_ANY, ia32_syscall_enable, NULL); SYSUNINIT(ia32_syscall, SI_SUB_EXEC, SI_ORDER_ANY, ia32_syscall_disable, NULL); + +#ifdef COMPAT_43 +int +setup_lcall_gate(void) +{ + struct i386_ldt_args uap; + struct user_segment_descriptor descs[2]; + struct gate_descriptor *ssd; + uint32_t lcall_addr; + int error; + + bzero(&uap, sizeof(uap)); + uap.start = 0; + uap.num = 2; + + /* + * This is the easiest way to cut the space for system + * descriptor in ldt. Manually adjust the descriptor type to + * the call gate later. + */ + bzero(&descs[0], sizeof(descs)); + descs[0].sd_type = SDT_SYSNULL; + descs[1].sd_type = SDT_SYSNULL; + error = amd64_set_ldt(curthread, &uap, descs); + if (error != 0) + return (error); + + lcall_addr = curproc->p_sysent->sv_psstrings - sz_lcall_tramp; + mtx_lock(&dt_lock); + ssd = (struct gate_descriptor *)(curproc->p_md.md_ldt->ldt_base); + bzero(ssd, sizeof(*ssd)); + ssd->gd_looffset = lcall_addr; + ssd->gd_hioffset = lcall_addr >> 16; + ssd->gd_selector = _ucode32sel; + ssd->gd_type = SDT_SYSCGT; + ssd->gd_dpl = SEL_UPL; + ssd->gd_p = 1; + mtx_unlock(&dt_lock); + + return (0); +} +#endif Modified: projects/altix/sys/amd64/linux32/linux.h ============================================================================== --- projects/altix/sys/amd64/linux32/linux.h Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/amd64/linux32/linux.h Mon Apr 4 03:41:18 2011 (r220315) @@ -695,7 +695,6 @@ union l_semun { #define LINUX_SO_NO_CHECK 11 #define LINUX_SO_PRIORITY 12 #define LINUX_SO_LINGER 13 -#define LINUX_SO_PASSCRED 16 #define LINUX_SO_PEERCRED 17 #define LINUX_SO_RCVLOWAT 18 #define LINUX_SO_SNDLOWAT 19 Modified: projects/altix/sys/arm/conf/AVILA ============================================================================== --- projects/altix/sys/arm/conf/AVILA Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/arm/conf/AVILA Mon Apr 4 03:41:18 2011 (r220315) @@ -120,7 +120,8 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_xauth -device ath # Atheros pci/cardbus NIC's +device ath # Atheros NIC's +device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI #options ATH_TX99_DIAG Modified: projects/altix/sys/arm/conf/CAMBRIA ============================================================================== --- projects/altix/sys/arm/conf/CAMBRIA Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/arm/conf/CAMBRIA Mon Apr 4 03:41:18 2011 (r220315) @@ -123,7 +123,8 @@ device wlan_ccmp # 802.11 CCMP support device wlan_tkip # 802.11 TKIP support device wlan_xauth -device ath # Atheros pci/cardbus NIC's +device ath # Atheros NIC's +device ath_pci # Atheros pci/cardbus glue options ATH_DEBUG options ATH_DIAGAPI #options ATH_TX99_DIAG Modified: projects/altix/sys/arm/econa/ehci_ebus.c ============================================================================== --- projects/altix/sys/arm/econa/ehci_ebus.c Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/arm/econa/ehci_ebus.c Mon Apr 4 03:41:18 2011 (r220315) @@ -241,7 +241,7 @@ ehci_ebus_detach(device_t self) * disable interrupts that might have been switched on in ehci_init */ if (sc->sc_io_res) { - EWRITE4(sc, EHCI_USBINTR, 0); + EOWRITE4(sc, EHCI_USBINTR, 0); EWRITE4(sc, USB_BRIDGE_INTR_MASK, 0); } if (sc->sc_irq_res && sc->sc_intr_hdl) { Modified: projects/altix/sys/boot/common/bootstrap.h ============================================================================== --- projects/altix/sys/boot/common/bootstrap.h Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/boot/common/bootstrap.h Mon Apr 4 03:41:18 2011 (r220315) @@ -296,8 +296,24 @@ struct arch_switch /* Perform ISA byte port I/O (only for systems with ISA) */ int (*arch_isainb)(int port); void (*arch_isaoutb)(int port, int value); - /* Pass in initial kernel memory size */ - void (*arch_maphint)(vm_offset_t va, size_t len); + + /* + * Interface to adjust the load address according to the "object" + * being loaded. + */ + uint64_t (*arch_loadaddr)(u_int type, void *data, uint64_t addr); +#define LOAD_ELF 1 /* data points to the ELF header. */ +#define LOAD_RAW 2 /* data points to the file name. */ + + /* + * Interface to inform MD code about a loaded (ELF) segment. This + * can be used to flush caches and/or set up translations. + */ +#ifdef __elfN + void (*arch_loadseg)(Elf_Ehdr *eh, Elf_Phdr *ph, uint64_t delta); +#else + void (*arch_loadseg)(void *eh, void *ph, uint64_t delta); +#endif }; extern struct arch_switch archsw; Modified: projects/altix/sys/boot/common/load_elf.c ============================================================================== --- projects/altix/sys/boot/common/load_elf.c Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/boot/common/load_elf.c Mon Apr 4 03:41:18 2011 (r220315) @@ -97,7 +97,6 @@ __elfN(loadfile)(char *filename, u_int64 struct elf_file ef; Elf_Ehdr *ehdr; int err; - u_int pad; ssize_t bytes_read; fp = NULL; @@ -157,12 +156,6 @@ __elfN(loadfile)(char *filename, u_int64 /* Looks OK, got ahead */ ef.kernel = 0; - /* Page-align the load address */ - pad = (u_int)dest & PAGE_MASK; - if (pad != 0) { - pad = PAGE_SIZE - pad; - dest += pad; - } } else if (ehdr->e_type == ET_EXEC) { /* Looks like a kernel */ if (kfp != NULL) { @@ -173,7 +166,7 @@ __elfN(loadfile)(char *filename, u_int64 /* * Calculate destination address based on kernel entrypoint */ - dest = ehdr->e_entry; + dest = (ehdr->e_entry & ~PAGE_MASK); if (dest == 0) { printf("elf" __XSTRING(__ELF_WORD_SIZE) "_loadfile: not a kernel (maybe static binary?)\n"); err = EPERM; @@ -186,6 +179,11 @@ __elfN(loadfile)(char *filename, u_int64 goto oerr; } + if (archsw.arch_loadaddr != NULL) + dest = archsw.arch_loadaddr(LOAD_ELF, ehdr, dest); + else + dest = roundup(dest, PAGE_SIZE); + /* * Ok, we think we should handle this. */ @@ -202,7 +200,7 @@ __elfN(loadfile)(char *filename, u_int64 #ifdef ELF_VERBOSE if (ef.kernel) - printf("%s entry at 0x%jx\n", filename, (uintmax_t)dest); + printf("%s entry at 0x%jx\n", filename, (uintmax_t)ehdr->e_entry); #else printf("%s ", filename); #endif @@ -362,6 +360,9 @@ __elfN(loadimage)(struct preloaded_file printf("\n"); #endif + if (archsw.arch_loadseg != NULL) + archsw.arch_loadseg(ehdr, phdr + i, off); + if (firstaddr == 0 || firstaddr > (phdr[i].p_vaddr + off)) firstaddr = phdr[i].p_vaddr + off; if (lastaddr == 0 || lastaddr < (phdr[i].p_vaddr + off + phdr[i].p_memsz)) Modified: projects/altix/sys/boot/common/load_elf_obj.c ============================================================================== --- projects/altix/sys/boot/common/load_elf_obj.c Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/boot/common/load_elf_obj.c Mon Apr 4 03:41:18 2011 (r220315) @@ -144,8 +144,10 @@ __elfN(obj_loadfile)(char *filename, u_i goto oerr; } - /* Page-align the load address */ - dest = roundup(dest, PAGE_SIZE); + if (archsw.arch_loadaddr != NULL) + dest = archsw.arch_loadaddr(LOAD_ELF, hdr, dest); + else + dest = roundup(dest, PAGE_SIZE); /* * Ok, we think we should handle this. Modified: projects/altix/sys/boot/common/module.c ============================================================================== --- projects/altix/sys/boot/common/module.c Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/boot/common/module.c Mon Apr 4 03:41:18 2011 (r220315) @@ -275,6 +275,9 @@ file_load(char *filename, vm_offset_t de int error; int i; + if (archsw.arch_loadaddr != NULL) + dest = archsw.arch_loadaddr(LOAD_RAW, filename, dest); + error = EFTYPE; for (i = 0, fp = NULL; file_formats[i] && fp == NULL; i++) { error = (file_formats[i]->l_load)(filename, loadaddr, &fp); @@ -352,9 +355,6 @@ file_loadraw(char *type, char *name) char *cp; int fd, got; vm_offset_t laddr; -#ifdef PC98 - struct stat st; -#endif /* We can't load first */ if ((file_findfile(NULL, NULL)) == NULL) { @@ -369,20 +369,15 @@ file_loadraw(char *type, char *name) return(CMD_ERROR); } name = cp; - + if ((fd = open(name, O_RDONLY)) < 0) { sprintf(command_errbuf, "can't open '%s': %s", name, strerror(errno)); free(name); return(CMD_ERROR); } -#ifdef PC98 - /* We cannot use 15M-16M area on pc98. */ - if (loadaddr < 0x1000000 && - fstat(fd, &st) == 0 && - (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) - loadaddr = 0x1000000; -#endif + if (archsw.arch_loadaddr != NULL) + loadaddr = archsw.arch_loadaddr(LOAD_RAW, name, loadaddr); laddr = loadaddr; for (;;) { @@ -489,14 +484,6 @@ mod_loadkld(const char *kldname, int arg ; do { -#ifdef PC98 - /* We cannot use 15M-16M area on pc98. */ - struct stat st; - if (loadaddr < 0x1000000 && - stat(filename, &st) == 0 && - (st.st_size == -1 || loadaddr + st.st_size > 0xf00000)) - loadaddr = 0x1000000; -#endif err = file_load(filename, loadaddr, &fp); if (err) break; Modified: projects/altix/sys/boot/ia64/common/copy.c ============================================================================== --- projects/altix/sys/boot/ia64/common/copy.c Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/boot/ia64/common/copy.c Mon Apr 4 03:41:18 2011 (r220315) @@ -28,10 +28,12 @@ __FBSDID("$FreeBSD$"); #include -#include +#include #include "libia64.h" +u_int ia64_legacy_kernel; + uint64_t *ia64_pgtbl; uint32_t ia64_pgtblsz; @@ -80,8 +82,8 @@ pgtbl_extend(u_int idx) return (0); } -static void * -va2pa(vm_offset_t va, size_t *len) +void * +ia64_va2pa(vm_offset_t va, size_t *len) { uint64_t pa; u_int idx, ofs; @@ -89,6 +91,7 @@ va2pa(vm_offset_t va, size_t *len) /* Backward compatibility. */ if (va >= IA64_RR_BASE(7)) { + ia64_legacy_kernel = 1; pa = IA64_RR_MASK(va); return ((void *)pa); } @@ -98,6 +101,8 @@ va2pa(vm_offset_t va, size_t *len) goto fail; } + ia64_legacy_kernel = 0; + idx = (va - IA64_PBVM_BASE) >> IA64_PBVM_PAGE_SHIFT; if (idx >= (ia64_pgtblsz >> 3)) { error = pgtbl_extend(idx); @@ -138,7 +143,7 @@ ia64_copyin(const void *src, vm_offset_t res = 0; while (len > 0) { sz = len; - pa = va2pa(va, &sz); + pa = ia64_va2pa(va, &sz); if (sz == 0) break; bcopy(src, pa, sz); @@ -159,7 +164,7 @@ ia64_copyout(vm_offset_t va, void *dst, res = 0; while (len > 0) { sz = len; - pa = va2pa(va, &sz); + pa = ia64_va2pa(va, &sz); if (sz == 0) break; bcopy(pa, dst, sz); @@ -170,6 +175,19 @@ ia64_copyout(vm_offset_t va, void *dst, return (res); } +uint64_t +ia64_loadaddr(u_int type, void *data, uint64_t addr) +{ + uint64_t align; + + /* + * Align ELF objects at PBVM page boundaries. Align all other + * objects at cache line boundaries for good measure. + */ + align = (type == LOAD_ELF) ? IA64_PBVM_PAGE_SIZE : CACHE_LINE_SIZE; + return ((addr + align - 1) & ~(align - 1)); +} + ssize_t ia64_readin(int fd, vm_offset_t va, size_t len) { @@ -180,7 +198,7 @@ ia64_readin(int fd, vm_offset_t va, size res = 0; while (len > 0) { sz = len; - pa = va2pa(va, &sz); + pa = ia64_va2pa(va, &sz); if (sz == 0) break; s = read(fd, pa, sz); Modified: projects/altix/sys/boot/ia64/common/exec.c ============================================================================== --- projects/altix/sys/boot/ia64/common/exec.c Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/boot/ia64/common/exec.c Mon Apr 4 03:41:18 2011 (r220315) @@ -36,13 +36,20 @@ __FBSDID("$FreeBSD$"); #include #include -#include - #include #include #include "libia64.h" +static u_int itr_idx = 0; +static u_int dtr_idx = 0; + +static vm_offset_t ia64_text_start; +static size_t ia64_text_size; + +static vm_offset_t ia64_data_start; +static size_t ia64_data_size; + static int elf64_exec(struct preloaded_file *amp); static int elf64_obj_exec(struct preloaded_file *amp); @@ -61,6 +68,26 @@ struct file_format *file_formats[] = { NULL }; +static u_int +sz2shft(vm_offset_t ofs, vm_size_t sz) +{ + vm_size_t s; + u_int shft; + + shft = 12; /* Start with 4K */ + s = 1 << shft; + while (s < sz) { + shft++; + s <<= 1; + } + do { + shft--; + s >>= 1; + } while (ofs & (s - 1)); + + return (shft); +} + /* * Entered with psr.ic and psr.i both zero. */ @@ -84,49 +111,43 @@ enter_kernel(uint64_t start, struct boot /* NOTREACHED */ } -static void -mmu_wire(vm_offset_t va, vm_paddr_t pa, vm_size_t sz, u_int acc) +static u_int +mmu_wire(vm_offset_t va, vm_paddr_t pa, u_int pgshft, u_int acc) { - static u_int iidx = 0, didx = 0; pt_entry_t pte; - u_int shft; /* Round up to the smallest possible page size. */ - if (sz < 4096) - sz = 4096; - /* Determine the exponent (base 2). */ - shft = 0; - while (sz > 1) { - shft++; - sz >>= 1; - } + if (pgshft < 12) + pgshft = 12; /* Truncate to the largest possible page size (256MB). */ - if (shft > 28) - shft = 28; + if (pgshft > 28) + pgshft = 28; /* Round down to a valid (mappable) page size. */ - if (shft > 14 && (shft & 1) != 0) - shft--; + if (pgshft > 14 && (pgshft & 1) != 0) + pgshft--; pte = PTE_PRESENT | PTE_MA_WB | PTE_ACCESSED | PTE_DIRTY | PTE_PL_KERN | (acc & PTE_AR_MASK) | (pa & PTE_PPN_MASK); __asm __volatile("mov cr.ifa=%0" :: "r"(va)); - __asm __volatile("mov cr.itir=%0" :: "r"(shft << 2)); + __asm __volatile("mov cr.itir=%0" :: "r"(pgshft << 2)); __asm __volatile("srlz.d;;"); - __asm __volatile("ptr.d %0,%1" :: "r"(va), "r"(shft << 2)); + __asm __volatile("ptr.d %0,%1" :: "r"(va), "r"(pgshft << 2)); __asm __volatile("srlz.d;;"); - __asm __volatile("itr.d dtr[%0]=%1" :: "r"(didx), "r"(pte)); + __asm __volatile("itr.d dtr[%0]=%1" :: "r"(dtr_idx), "r"(pte)); __asm __volatile("srlz.d;;"); - didx++; + dtr_idx++; - if (acc == PTE_AR_RWX) { - __asm __volatile("ptr.i %0,%1;;" :: "r"(va), "r"(shft << 2)); + if (acc == PTE_AR_RWX || acc == PTE_AR_RX) { + __asm __volatile("ptr.i %0,%1;;" :: "r"(va), "r"(pgshft << 2)); __asm __volatile("srlz.i;;"); - __asm __volatile("itr.i itr[%0]=%1;;" :: "r"(iidx), "r"(pte)); + __asm __volatile("itr.i itr[%0]=%1;;" :: "r"(itr_idx), "r"(pte)); __asm __volatile("srlz.i;;"); - iidx++; + itr_idx++; } + + return (pgshft); } static void @@ -143,28 +164,43 @@ mmu_setup_legacy(uint64_t entry) ia64_set_rr(IA64_RR_BASE(7), (7 << 8) | (28 << 2)); __asm __volatile("srlz.i;;"); - mmu_wire(entry, IA64_RR_MASK(entry), 1UL << 28, PTE_AR_RWX); + mmu_wire(entry, IA64_RR_MASK(entry), 28, PTE_AR_RWX); } static void -mmu_setup_paged(vm_offset_t pbvm_top) +mmu_setup_paged(struct bootinfo *bi) { - vm_size_t sz; + void *pa; + size_t sz; + u_int shft; ia64_set_rr(IA64_RR_BASE(IA64_PBVM_RR), (IA64_PBVM_RR << 8) | (IA64_PBVM_PAGE_SHIFT << 2)); __asm __volatile("srlz.i;;"); /* Wire the PBVM page table. */ - mmu_wire(IA64_PBVM_PGTBL, (uintptr_t)ia64_pgtbl, ia64_pgtblsz, - PTE_AR_RW); + mmu_wire(IA64_PBVM_PGTBL, (uintptr_t)ia64_pgtbl, + sz2shft(IA64_PBVM_PGTBL, ia64_pgtblsz), PTE_AR_RW); - /* Wire as much of the PBVM we can. This must be a power of 2. */ - sz = pbvm_top - IA64_PBVM_BASE; - sz = (sz + IA64_PBVM_PAGE_MASK) & ~IA64_PBVM_PAGE_MASK; - while (sz & (sz - 1)) - sz -= IA64_PBVM_PAGE_SIZE; - mmu_wire(IA64_PBVM_BASE, ia64_pgtbl[0], sz, PTE_AR_RWX); + /* Wire as much of the text segment as we can. */ + sz = ia64_text_size; /* XXX */ + pa = ia64_va2pa(ia64_text_start, &ia64_text_size); + ia64_text_size = sz; /* XXX */ + shft = sz2shft(ia64_text_start, ia64_text_size); + shft = mmu_wire(ia64_text_start, (uintptr_t)pa, shft, PTE_AR_RX); + ia64_copyin(&shft, (uintptr_t)&bi->bi_text_mapped, 4); + + /* Wire as much of the data segment as well. */ + sz = ia64_data_size; /* XXX */ + pa = ia64_va2pa(ia64_data_start, &ia64_data_size); + ia64_data_size = sz; /* XXX */ + shft = sz2shft(ia64_data_start, ia64_data_size); + shft = mmu_wire(ia64_data_start, (uintptr_t)pa, shft, PTE_AR_RW); + ia64_copyin(&shft, (uintptr_t)&bi->bi_data_mapped, 4); + + /* Update the bootinfo with the number of TRs used. */ + ia64_copyin(&itr_idx, (uintptr_t)&bi->bi_itr_used, 4); + ia64_copyin(&dtr_idx, (uintptr_t)&bi->bi_dtr_used, 4); } static int @@ -196,7 +232,7 @@ elf64_exec(struct preloaded_file *fp) if (IS_LEGACY_KERNEL()) mmu_setup_legacy(hdr->e_entry); else - mmu_setup_paged((uintptr_t)(bi + 1)); + mmu_setup_paged(bi); enter_kernel(hdr->e_entry, bi); /* NOTREACHED */ @@ -211,3 +247,20 @@ elf64_obj_exec(struct preloaded_file *fp fp->f_name); return (ENOSYS); } + +void +ia64_loadseg(Elf_Ehdr *eh, Elf_Phdr *ph, uint64_t delta) +{ + + if (eh->e_type != ET_EXEC) + return; + + if (ph->p_flags & PF_X) { + ia64_text_start = ph->p_vaddr + delta; + ia64_text_size = ph->p_memsz; + } else { + ia64_data_start = ph->p_vaddr + delta; + ia64_data_size = ph->p_memsz; + } +} + Modified: projects/altix/sys/boot/ia64/common/libia64.h ============================================================================== --- projects/altix/sys/boot/ia64/common/libia64.h Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/boot/ia64/common/libia64.h Mon Apr 4 03:41:18 2011 (r220315) @@ -31,9 +31,9 @@ #include #include -#include +#include -#define IS_LEGACY_KERNEL() (ia64_pgtbl == NULL || ia64_pgtblsz == 0) +#define IS_LEGACY_KERNEL() (ia64_legacy_kernel) /* * Portability functions provided by the loader @@ -48,15 +48,24 @@ int ia64_platform_enter(const char *); * Functions and variables provided by the ia64 common code * and shared by all loader implementations. */ +extern u_int ia64_legacy_kernel; + extern uint64_t *ia64_pgtbl; extern uint32_t ia64_pgtblsz; int ia64_autoload(void); int ia64_bootinfo(struct preloaded_file *, struct bootinfo **); +uint64_t ia64_loadaddr(u_int, void *, uint64_t); +#ifdef __elfN +void ia64_loadseg(Elf_Ehdr *, Elf_Phdr *, uint64_t); +#else +void ia64_loadseg(void *, void *, uint64_t); +#endif ssize_t ia64_copyin(const void *, vm_offset_t, size_t); ssize_t ia64_copyout(vm_offset_t, void *, size_t); ssize_t ia64_readin(int, vm_offset_t, size_t); +void *ia64_va2pa(vm_offset_t, size_t *); char *ia64_fmtdev(struct devdesc *); int ia64_getdev(void **, const char *, const char **); Modified: projects/altix/sys/boot/ia64/efi/main.c ============================================================================== --- projects/altix/sys/boot/ia64/efi/main.c Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/boot/ia64/efi/main.c Mon Apr 4 03:41:18 2011 (r220315) @@ -196,9 +196,11 @@ main(int argc, CHAR16 *argv[]) setenv("LINES", "24", 1); /* optional */ archsw.arch_autoload = ia64_autoload; - archsw.arch_getdev = ia64_getdev; archsw.arch_copyin = ia64_copyin; archsw.arch_copyout = ia64_copyout; + archsw.arch_getdev = ia64_getdev; + archsw.arch_loadaddr = ia64_loadaddr; + archsw.arch_loadseg = ia64_loadseg; archsw.arch_readin = ia64_readin; interact(); /* doesn't return */ Modified: projects/altix/sys/boot/ia64/ski/efi_stub.c ============================================================================== --- projects/altix/sys/boot/ia64/ski/efi_stub.c Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/boot/ia64/ski/efi_stub.c Mon Apr 4 03:41:18 2011 (r220315) @@ -28,8 +28,8 @@ __FBSDID("$FreeBSD$"); #include +#include #include -#include #include #include "libski.h" @@ -223,39 +223,37 @@ ResetSystem(enum efi_reset type, efi_sta void efi_stub_init(struct bootinfo *bi) { - struct efi_md *memp; + static struct efi_md memmap[4]; /* Describe the SKI memory map. */ - bi->bi_memmap = (u_int64_t)(bi + 1); - bi->bi_memmap_size = 4 * sizeof(struct efi_md); + bi->bi_memmap = (uintptr_t)(void *)memmap; + bi->bi_memmap_size = sizeof(memmap); bi->bi_memdesc_size = sizeof(struct efi_md); bi->bi_memdesc_version = 1; - memp = (struct efi_md *)bi->bi_memmap; - - memp[0].md_type = EFI_MD_TYPE_PALCODE; - memp[0].md_phys = 0x100000; - memp[0].md_virt = NULL; - memp[0].md_pages = (4L*1024*1024)>>12; - memp[0].md_attr = EFI_MD_ATTR_WB | EFI_MD_ATTR_RT; - - memp[1].md_type = EFI_MD_TYPE_FREE; - memp[1].md_phys = 5L*1024*1024; - memp[1].md_virt = NULL; - memp[1].md_pages = (128L*1024*1024)>>12; - memp[1].md_attr = EFI_MD_ATTR_WB; - - memp[2].md_type = EFI_MD_TYPE_FREE; - memp[2].md_phys = 4L*1024*1024*1024; - memp[2].md_virt = NULL; - memp[2].md_pages = (64L*1024*1024)>>12; - memp[2].md_attr = EFI_MD_ATTR_WB; - - memp[3].md_type = EFI_MD_TYPE_IOPORT; - memp[3].md_phys = 0xffffc000000; - memp[3].md_virt = NULL; - memp[3].md_pages = (64L*1024*1024)>>12; - memp[3].md_attr = EFI_MD_ATTR_UC; + memmap[0].md_type = EFI_MD_TYPE_PALCODE; + memmap[0].md_phys = 0x100000; + memmap[0].md_virt = NULL; + memmap[0].md_pages = (1L*1024*1024)>>12; + memmap[0].md_attr = EFI_MD_ATTR_WB | EFI_MD_ATTR_RT; + + memmap[1].md_type = EFI_MD_TYPE_FREE; + memmap[1].md_phys = 4L*1024*1024; + memmap[1].md_virt = NULL; + memmap[1].md_pages = (128L*1024*1024)>>12; + memmap[1].md_attr = EFI_MD_ATTR_WB; + + memmap[2].md_type = EFI_MD_TYPE_FREE; + memmap[2].md_phys = 4L*1024*1024*1024; + memmap[2].md_virt = NULL; + memmap[2].md_pages = (64L*1024*1024)>>12; + memmap[2].md_attr = EFI_MD_ATTR_WB; + + memmap[3].md_type = EFI_MD_TYPE_IOPORT; + memmap[3].md_phys = 0xffffc000000; + memmap[3].md_virt = NULL; + memmap[3].md_pages = (64L*1024*1024)>>12; + memmap[3].md_attr = EFI_MD_ATTR_UC; bi->bi_systab = (u_int64_t)&efi_systab; } Modified: projects/altix/sys/boot/ia64/ski/main.c ============================================================================== --- projects/altix/sys/boot/ia64/ski/main.c Mon Apr 4 02:57:19 2011 (r220314) +++ projects/altix/sys/boot/ia64/ski/main.c Mon Apr 4 03:41:18 2011 (r220315) @@ -97,11 +97,13 @@ ski_main(void) env_nounset); setenv("LINES", "24", 1); /* optional */ *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-projects@FreeBSD.ORG Tue Apr 5 01:42:06 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BB77106566C; Tue, 5 Apr 2011 01:42:06 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8BABF8FC18; Tue, 5 Apr 2011 01:42:06 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p351g6Co001602; Tue, 5 Apr 2011 01:42:06 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p351g607001600; Tue, 5 Apr 2011 01:42:06 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201104050142.p351g607001600@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 5 Apr 2011 01:42:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220348 - projects/altix/sys/ia64/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2011 01:42:06 -0000 Author: marcel Date: Tue Apr 5 01:42:06 2011 New Revision: 220348 URL: http://svn.freebsd.org/changeset/base/220348 Log: o Define a geoid structure to make it easier to extract the components. o Re-define some of the fwbus fields. They don't seem to be defined by the PROM. o Add structures for the KLCONFIG data, constructed by the firmware during hardware discovery. Modified: projects/altix/sys/ia64/include/sgisn.h Modified: projects/altix/sys/ia64/include/sgisn.h ============================================================================== --- projects/altix/sys/ia64/include/sgisn.h Mon Apr 4 22:56:33 2011 (r220347) +++ projects/altix/sys/ia64/include/sgisn.h Tue Apr 5 01:42:06 2011 (r220348) @@ -29,7 +29,7 @@ #define _MACHINE_SGISN_H_ /* SAL functions */ -#define SAL_SGISN_KLCONFIG_ADDR 0x02000005 +#define SAL_SGISN_KLCFG_ADDR 0x02000005 #define SAL_SGISN_SAPIC_INFO 0x0200001d #define SAL_SGISN_SN_INFO 0x0200001e #define SAL_SGISN_PUTC 0x02000021 @@ -42,24 +42,6 @@ #define SAL_SGISN_FEATURE_GET_PROM 0x02000065 #define SAL_SGISN_FEATURE_SET_OS 0x02000066 -#define SGISN_GEOID_MODULE(id) (((id) >> 0) & 0xffffffffu) -#define SGISN_GEOID_TYPE(id) (((id) >> 32) & 0xff) -#define SGISN_GEOID_SLAB(id) (((id) >> 40) & 0xff) -#define SGISN_GEOID_ADDIT(id) (((id) >> 48) & 0xffff); -#define SGISN_GEOID_CPU_SLICE(id) ((SGISN_GEOID_ADDIT(id) >> 0) & 0xff) -#define SGISN_GEOID_DEV_BUS(id) ((SGISN_GEOID_ADDIT(id) >> 0) & 0xff) -#define SGISN_GEOID_DEV_SLOT(id) ((SGISN_GEOID_ADDIT(id) >> 8) & 0xff) -#define SGISN_GEOID_MEM_BUS(id) ((SGISN_GEOID_ADDIT(id) >> 0) & 0xff) -#define SGISN_GEOID_MEM_SLOT(id) ((SGISN_GEOID_ADDIT(id) >> 8) & 0xff) - -#define SGISN_GEO_TYPE_INVALID 0 -#define SGISN_GEO_TYPE_MODULE 1 -#define SGISN_GEO_TYPE_NODE 2 -#define SGISN_GEO_TYPE_RTR 3 -#define SGISN_GEO_TYPE_IOC 4 -#define SGISN_GEO_TYPE_DEV 5 /* PCI device */ -#define SGISN_GEO_TYPE_CPU 6 -#define SGISN_GEO_TYPE_MEM 7 #define SGISN_HUB_NITTES 8 #define SGISN_HUB_NWIDGETS 16 @@ -67,6 +49,34 @@ #define SHUB_IVAR_PCIBUS 1 #define SHUB_IVAR_PCISEG 2 +struct sgisn_geoid { + uint32_t sg_module; + uint8_t sg_type; +#define SGISN_GEOID_TYPE_INVALID 0 +#define SGISN_GEOID_TYPE_MODULE 1 +#define SGISN_GEOID_TYPE_NODE 2 +#define SGISN_GEOID_TYPE_RTR 3 +#define SGISN_GEOID_TYPE_IOC 4 +#define SGISN_GEOID_TYPE_DEV 5 /* PCI device */ +#define SGISN_GEOID_TYPE_CPU 6 +#define SGISN_GEOID_TYPE_MEM 7 + uint8_t sg_slab:4; + uint8_t sg_slot:4; + union { + struct { + uint8_t slice; + } cpu; + struct { + uint8_t bus; + uint8_t slot; + } dev; + struct { + uint8_t bus; + uint8_t slot; + } mem; + } sg_u; +}; + struct sgisn_fwhub; struct sgisn_widget { @@ -92,7 +102,7 @@ struct sgisn_fwbus { }; struct sgisn_fwhub { - uint64_t hub_geoid; + struct sgisn_geoid hub_geoid; uint16_t hub_nasid; uint16_t hub_peer_nasid; uint32_t _pad; @@ -130,10 +140,81 @@ struct sgisn_fwdev { uint64_t dev_bar[6]; uint64_t dev_romaddr; uint64_t dev_handle; - struct sgisn_fwbus *dev_bus_softc; - struct sgisn_fwdev *dev_parent; - void *dev_os_devptr; + uint64_t dev_os_private[3]; struct sgisn_fwirq *dev_irq; + uint64_t dev_xxx[4]; +}; + +/* + * KLCFG stuff... + */ + +static __inline void * +sgisn_klcfg_ptr(uint64_t base, int32_t ofs) +{ + void *ptr; + + ptr = (void *)IA64_PHYS_TO_RR7(base + ofs); + return (ptr); +} + +struct sgisn_klcfg_hdr { + uint64_t skh_magic; +#define SGISN_KLCFG_MAGIC 0xbeedbabe + uint32_t skh_version; + int32_t skh_ofs_mallocs; + int32_t skh_ofs_console; + int32_t skh_board_info; + /* more fields here. */ +}; + +struct sgisn_klcfg_board { + int32_t skb_next; + uint8_t skb_affinity; /* local or remote */ +#define SGISN_KLCFG_BOARD_TYPE_LOCAL 1 +#define SGISN_KLCFG_BOARD_TYPE_REMOTE 2 + uint8_t skb_type; + uint8_t skb_version; /* structure version */ + uint8_t skb_revision; /* board revision */ + uint8_t skb_promver; + uint8_t skb_flags; + uint8_t skb_slot; + uint16_t skb_dbgsw; + struct sgisn_geoid skb_geoid; + int8_t skb_partition; + uint16_t skb_diag[4]; /* xxx */ + uint8_t skb_inventory; + uint8_t skb_ncompts; + uint64_t skb_nic; + int16_t skb_nasid; + int32_t skb_compts[24]; + int32_t skb_errinfo; + int32_t skb_parent; + uint32_t _pad1; + uint8_t skb_badness; + int16_t skb_owner; + uint8_t skb_nicflags; + uint8_t _pad2[28]; + char skb_name[32]; + int16_t skb_peer_host; + int32_t skb_peer; +}; + +struct sgisn_klcfg_compt { + uint8_t skc_type; + uint8_t skc_version; + uint8_t skc_flags; + uint8_t skc_revision; + uint16_t skc_diag[2]; + uint8_t skc_inventory; + uint16_t skc_partid; + uint64_t skc_nic; + uint8_t skc_physid; + uint32_t skc_virtid; + uint8_t skc_wdgtid; + int16_t skc_nasid; + uint64_t skc_data; + int32_t skc_errinfo; }; #endif /* !_MACHINE_SGISN_H_ */ From owner-svn-src-projects@FreeBSD.ORG Tue Apr 5 01:51:30 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9BD0A1065670; Tue, 5 Apr 2011 01:51:30 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 714638FC08; Tue, 5 Apr 2011 01:51:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p351pUlU001816; Tue, 5 Apr 2011 01:51:30 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p351pUEN001814; Tue, 5 Apr 2011 01:51:30 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201104050151.p351pUEN001814@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 5 Apr 2011 01:51:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220349 - projects/altix/sys/ia64/sgisn X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2011 01:51:30 -0000 Author: marcel Date: Tue Apr 5 01:51:30 2011 New Revision: 220349 URL: http://svn.freebsd.org/changeset/base/220349 Log: When enumerating the busses (in all domains) on the BSP, the firmware returns all of busses in the system, not just the busses local to the BSP. We use the base address of the bus to extract the NASID and use that to match busses against shubs. Consequently, the logical device hierarchy is the same as the physical interconnect. Modified: projects/altix/sys/ia64/sgisn/sgisn_shub.c Modified: projects/altix/sys/ia64/sgisn/sgisn_shub.c ============================================================================== --- projects/altix/sys/ia64/sgisn/sgisn_shub.c Tue Apr 5 01:42:06 2011 (r220348) +++ projects/altix/sys/ia64/sgisn/sgisn_shub.c Tue Apr 5 01:51:30 2011 (r220349) @@ -348,6 +348,7 @@ sgisn_shub_attach(device_t dev) { struct ia64_sal_result r; struct sgisn_shub_softc *sc; + struct sgisn_fwbus *fwbus; ACPI_TABLE_HEADER *tbl; device_t child; void *ptr; @@ -410,33 +411,21 @@ sgisn_shub_attach(device_t dev) for (wdgt = 0; wdgt < SGISN_HUB_NWIDGETS; wdgt++) sc->sc_fwhub->hub_widget[wdgt].wgt_hub = sc->sc_fwhub; - r = ia64_sal_entry(SAL_SGISN_KLCONFIG_ADDR, sc->sc_nasid, - 0, 0, 0, 0, 0, 0); - device_printf(dev, "KLCONFIG: status=%#lx, addr=%#lx\n", - r.sal_status, r.sal_result[0]); - - /* - * XXX Hack to avoid having the same PCI busses as children of any - * SHub we have. The problem is that we can't pass the nasid to the - * the SAL function. So either we get all the busses, irrespective - * of the node in which they live or we always get the busses local - * to the CPU. I can't tell the difference, because I don't have - * busses on the other brick right now. - * In any case: we don't have a good way yet to figure out if the - * bus connects to the SHub in question. - */ - if (sc->sc_nasid != 0) - return (0); - for (seg = 0; seg <= sc->sc_fwhub->hub_pci_maxseg; seg++) { for (bus = 0; bus <= sc->sc_fwhub->hub_pci_maxbus; bus++) { r = ia64_sal_entry(SAL_SGISN_IOBUS_INFO, seg, bus, ia64_tpa((uintptr_t)&addr), 0, 0, 0, 0); - if (r.sal_status == 0 && addr != 0) { - child = device_add_child(dev, "pcib", -1); - device_set_ivars(child, (void *)(uintptr_t) - ((seg << 8) | (bus & 0xff))); - } + if (r.sal_status != 0 || addr == 0) + continue; + + fwbus = (void *)IA64_PHYS_TO_RR7(addr); + if (((fwbus->bus_base >> sc->sc_nasid_shft) & + sc->sc_nasid_mask) != sc->sc_nasid) + continue; + + child = device_add_child(dev, "pcib", -1); + device_set_ivars(child, + (void *)(uintptr_t) ((seg << 8) | (bus & 0xff))); } } From owner-svn-src-projects@FreeBSD.ORG Tue Apr 5 15:33:12 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AADF81065672; Tue, 5 Apr 2011 15:33:12 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 99E2D8FC34; Tue, 5 Apr 2011 15:33:12 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p35FXCWe022539; Tue, 5 Apr 2011 15:33:12 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p35FXCcT022531; Tue, 5 Apr 2011 15:33:12 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201104051533.p35FXCcT022531@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 5 Apr 2011 15:33:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220365 - in projects/altix/sys: conf ia64/ia64 ia64/include X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Apr 2011 15:33:12 -0000 Author: marcel Date: Tue Apr 5 15:33:12 2011 New Revision: 220365 URL: http://svn.freebsd.org/changeset/base/220365 Log: Slightly tweak how we're running in PBVM. In particular: 1. The loader maps the beginning of text as well as the beginning of data. Put critical text and data (read: IVT related) at the beginning of the segments to make sure we don't get nested faults when we can't deal with them. 2. The loader uses more TRs, so use different ones for now. This should all be dynamic and handled by TR management code. This will do for now. This works for kernels and fixes the hard hangs when trying to run user space. The problem was that critical data was not mapped and we got nested TLB faults. Modified: projects/altix/sys/conf/ldscript.ia64 projects/altix/sys/ia64/ia64/exception.S projects/altix/sys/ia64/ia64/genassym.c projects/altix/sys/ia64/ia64/locore.S projects/altix/sys/ia64/ia64/machdep.c projects/altix/sys/ia64/ia64/pmap.c projects/altix/sys/ia64/include/md_var.h Modified: projects/altix/sys/conf/ldscript.ia64 ============================================================================== --- projects/altix/sys/conf/ldscript.ia64 Tue Apr 5 15:11:09 2011 (r220364) +++ projects/altix/sys/conf/ldscript.ia64 Tue Apr 5 15:33:12 2011 (r220365) @@ -11,10 +11,10 @@ SECTIONS .interp : { *(.interp) } PROVIDE (btext = .); - .ivt : { *(.ivt) } .text : { - *(.text.ivt) + *(.ivt) + *(.ivt.text) *(.text .stub .text.* .gnu.linkonce.t.*) /* .gnu.warning sections are handled specially by elf32.em. */ *(.gnu.warning) @@ -62,7 +62,8 @@ SECTIONS .data : { - *(.data.kstack .data .data.* .gnu.linkonce.d.*) + *(.ivt.data) + *(.data .data.* .gnu.linkonce.d.*) SORT(CONSTRUCTORS) } .data1 : { *(.data1) } Modified: projects/altix/sys/ia64/ia64/exception.S ============================================================================== --- projects/altix/sys/ia64/ia64/exception.S Tue Apr 5 15:11:09 2011 (r220364) +++ projects/altix/sys/ia64/ia64/exception.S Tue Apr 5 15:33:12 2011 (r220365) @@ -48,9 +48,16 @@ __FBSDID("$FreeBSD$"); * ar.k4 = PCPU data */ + .section .ivt.data, "aw" + + .global pmap_ptc_g_sem +pmap_ptc_g_sem: data8 0 + + .global ia64_kptdir +ia64_kptdir: data8 0 + #ifdef EXCEPTION_TRACING - .data .global xtrace, xhead xtrace: .space 1024*5*8 xhead: data8 xtrace @@ -101,7 +108,7 @@ xhead: data8 xtrace #endif - .section .text.ivt, "ax" + .section .ivt.text, "ax" /* * exception_save: save interrupted state @@ -129,7 +136,7 @@ ENTRY_NOPROFILE(exception_save, 0) ;; } { .mmi - cmp.le p14,p15=5,r31 + cmp.le p14,p15=IA64_VM_MINKERN_REGION,r31 ;; (p15) mov r23=ar.k7 // kernel memory stack (p14) mov r23=sp @@ -233,7 +240,7 @@ exception_save_restart: { .mmi st8 [r30]=r19,16 // rnat st8 [r31]=r0,16 // __spare - cmp.le p12,p13=5,r24 + cmp.le p12,p13=IA64_VM_MINKERN_REGION,r24 ;; } { .mmi @@ -602,7 +609,7 @@ ENTRY_NOPROFILE(exception_restore, 0) { .mmi ld8.fill r1=[r30],16 // gp ld8 r27=[r31],16 // ndirty - cmp.le p14,p15=5,r28 + cmp.le p14,p15=IA64_VM_MINKERN_REGION,r28 ;; } { .mmi @@ -915,7 +922,7 @@ IVT_ENTRY(Alternate_Instruction_TLB, 0x0 extr.u r17=r16,61,3 // get region number mov r19=PTE_PRESENT+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+PTE_AR_RWX ;; - cmp.eq p13,p0=4,r17 // RR4? + cmp.eq p13,p0=IA64_PBVM_RR,r17 // RR4? (p13) br.cond.sptk.few 4f ;; cmp.ge p13,p0=5,r17 // RR0-RR5? @@ -958,7 +965,7 @@ IVT_ENTRY(Alternate_Data_TLB, 0x1000) extr.u r17=r16,61,3 // get region number mov r19=PTE_PRESENT+PTE_ACCESSED+PTE_DIRTY+PTE_PL_KERN+PTE_AR_RWX ;; - cmp.eq p13,p0=4,r17 // RR4? + cmp.eq p13,p0=IA64_PBVM_RR,r17 // RR4? (p13) br.cond.sptk.few 4f ;; cmp.ge p13,p0=5,r17 // RR0-RR5? @@ -1007,21 +1014,22 @@ IVT_ENTRY(Data_Nested_TLB, 0x1400) // double nested faults. Since all virtual addresses we encounter // here are direct mapped region 7 addresses, we have no problem // constructing physical addresses. + { .mlx - rsm psr.dt + nop 0 movl r27=ia64_kptdir ;; } { .mii - srlz.d - dep r27=0,r27,61,3 - ;; + ld8 r27=[r27] extr.u r28=r30,3*PAGE_SHIFT-8, PAGE_SHIFT-3 // dir L0 index -} -{ .mii - ld8 r27=[r27] // dir L0 page extr.u r26=r30,2*PAGE_SHIFT-5, PAGE_SHIFT-3 // dir L1 index ;; +} +{ .mmi + rsm psr.dt + ;; + srlz.d dep r27=0,r27,61,3 ;; } Modified: projects/altix/sys/ia64/ia64/genassym.c ============================================================================== --- projects/altix/sys/ia64/ia64/genassym.c Tue Apr 5 15:11:09 2011 (r220364) +++ projects/altix/sys/ia64/ia64/genassym.c Tue Apr 5 15:33:12 2011 (r220365) @@ -82,6 +82,8 @@ ASSYM(IA64_PBVM_PAGE_SHIFT, IA64_PBVM_PA ASSYM(IA64_PBVM_PGTBL, IA64_PBVM_PGTBL); ASSYM(IA64_PBVM_RR, IA64_PBVM_RR); +ASSYM(IA64_VM_MINKERN_REGION, IA64_VM_MINKERN_REGION); + ASSYM(KSTACK_PAGES, KSTACK_PAGES); ASSYM(MC_PRESERVED, offsetof(mcontext_t, mc_preserved)); Modified: projects/altix/sys/ia64/ia64/locore.S ============================================================================== --- projects/altix/sys/ia64/ia64/locore.S Tue Apr 5 15:11:09 2011 (r220364) +++ projects/altix/sys/ia64/ia64/locore.S Tue Apr 5 15:33:12 2011 (r220365) @@ -1,4 +1,5 @@ /*- + * Copyright (c) 2001-2011 Marcel Moolenaar * Copyright (c) 1998 Doug Rabson * All rights reserved. * @@ -40,7 +41,7 @@ */ #define FW_STACK_SIZE 3*PAGE_SIZE - .section .data.kstack, "aw" + .section .ivt.data, "aw" .align PAGE_SIZE .global kstack kstack: .space FW_STACK_SIZE @@ -80,13 +81,17 @@ ENTRY_NOPROFILE(__start, 1) movl gp=__gp // find kernel globals ;; } - +{ .mlx mov ar.bspstore=r16 // switch backing store + movl r16=bootinfo ;; +} +{ .mmi + st8 [r16]=r8 // save the PA of the bootinfo block loadrs // invalidate regs mov r17=IA64_DCR_DEFAULT ;; - +} { .mmi mov cr.dcr=r17 mov ar.rsc=3 // turn rse back on @@ -100,13 +105,13 @@ ENTRY_NOPROFILE(__start, 1) ;; // we just need to process fptrs } { .mib - mov r9=r8 // Save pointer to bootinfo. + nop 0 nop 0 br.call.sptk.many rp=_reloc ;; } { .mib - mov out0=r9 // Pass pointer to bootinfo. + nop 0 nop 0 br.call.sptk.many rp=ia64_init ;; Modified: projects/altix/sys/ia64/ia64/machdep.c ============================================================================== --- projects/altix/sys/ia64/ia64/machdep.c Tue Apr 5 15:11:09 2011 (r220364) +++ projects/altix/sys/ia64/ia64/machdep.c Tue Apr 5 15:33:12 2011 (r220365) @@ -573,7 +573,7 @@ map_vhpt(uintptr_t vhpt) ia64_set_ifa(vhpt); ia64_set_itir(pmap_vhpt_log2size << 2); ia64_srlz_d(); - __asm __volatile("itr.d dtr[%0]=%1" :: "r"(4), "r"(pte)); + __asm __volatile("itr.d dtr[%0]=%1" :: "r"(3), "r"(pte)); __asm __volatile("mov psr.l=%0" :: "r" (psr)); ia64_srlz_i(); } @@ -611,9 +611,9 @@ map_pal_code(void) ia64_set_ifa(va); ia64_set_itir(shft << 2); ia64_srlz_d(); - __asm __volatile("itr.d dtr[%0]=%1" :: "r"(2), "r"(pte)); + __asm __volatile("itr.d dtr[%0]=%1" :: "r"(4), "r"(pte)); ia64_srlz_d(); - __asm __volatile("itr.i itr[%0]=%1" :: "r"(2), "r"(pte)); + __asm __volatile("itr.i itr[%0]=%1" :: "r"(1), "r"(pte)); __asm __volatile("mov psr.l=%0" :: "r" (psr)); ia64_srlz_i(); } @@ -637,9 +637,9 @@ map_gateway_page(void) ia64_set_ifa(VM_MAXUSER_ADDRESS); ia64_set_itir(PAGE_SHIFT << 2); ia64_srlz_d(); - __asm __volatile("itr.d dtr[%0]=%1" :: "r"(3), "r"(pte)); + __asm __volatile("itr.d dtr[%0]=%1" :: "r"(5), "r"(pte)); ia64_srlz_d(); - __asm __volatile("itr.i itr[%0]=%1" :: "r"(3), "r"(pte)); + __asm __volatile("itr.i itr[%0]=%1" :: "r"(2), "r"(pte)); __asm __volatile("mov psr.l=%0" :: "r" (psr)); ia64_srlz_i(); @@ -685,7 +685,7 @@ calculate_frequencies(void) } struct ia64_init_return -ia64_init(struct bootinfo *bi) +ia64_init(void) { struct ia64_init_return ret; int phys_avail_cnt; @@ -697,8 +697,6 @@ ia64_init(struct bootinfo *bi) /* NO OUTPUT ALLOWED UNTIL FURTHER NOTICE */ - bootinfo = bi; - /* * TODO: Disable interrupts, floating point etc. * Maybe flush cache and tlb Modified: projects/altix/sys/ia64/ia64/pmap.c ============================================================================== --- projects/altix/sys/ia64/ia64/pmap.c Tue Apr 5 15:11:09 2011 (r220364) +++ projects/altix/sys/ia64/ia64/pmap.c Tue Apr 5 15:33:12 2011 (r220365) @@ -159,7 +159,8 @@ vm_offset_t virtual_end; /* VA of last a * Kernel virtual memory management. */ static int nkpt; -struct ia64_lpte ***ia64_kptdir; +extern struct ia64_lpte ***ia64_kptdir; + #define KPTE_DIR0_INDEX(va) \ (((va) >> (3*PAGE_SHIFT-8)) & ((1<<(PAGE_SHIFT-3))-1)) #define KPTE_DIR1_INDEX(va) \ @@ -177,7 +178,7 @@ static uint64_t pmap_ptc_e_count2 = 2; static uint64_t pmap_ptc_e_stride1 = 0x2000; static uint64_t pmap_ptc_e_stride2 = 0x100000000; -volatile u_long pmap_ptc_g_sem; +extern volatile u_long pmap_ptc_g_sem; /* * Data for the RID allocator Modified: projects/altix/sys/ia64/include/md_var.h ============================================================================== --- projects/altix/sys/ia64/include/md_var.h Tue Apr 5 15:11:09 2011 (r220364) +++ projects/altix/sys/ia64/include/md_var.h Tue Apr 5 15:33:12 2011 (r220365) @@ -61,7 +61,6 @@ ia64_bsp_adjust(uint64_t bsp, int nslots #ifdef _KERNEL struct _special; -struct bootinfo; struct pcpu; struct thread; struct trapframe; @@ -94,7 +93,7 @@ int ia64_highfp_drop(struct thread *); int ia64_highfp_enable(struct thread *, struct trapframe *); int ia64_highfp_save(struct thread *); int ia64_highfp_save_ipi(void); -struct ia64_init_return ia64_init(struct bootinfo *); +struct ia64_init_return ia64_init(void); u_int ia64_itc_freq(void); void ia64_probe_sapics(void); void ia64_sync_icache(vm_offset_t, vm_size_t); From owner-svn-src-projects@FreeBSD.ORG Wed Apr 6 12:05:11 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 949D210656DD; Wed, 6 Apr 2011 12:05:11 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8427F8FC18; Wed, 6 Apr 2011 12:05:09 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p36C59Wg087709; Wed, 6 Apr 2011 12:05:09 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p36C59t5087708; Wed, 6 Apr 2011 12:05:09 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201104061205.p36C59t5087708@svn.freebsd.org> From: Peter Holm Date: Wed, 6 Apr 2011 12:05:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220383 - projects/stress2/misc X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2011 12:05:11 -0000 Author: pho Date: Wed Apr 6 12:05:09 2011 New Revision: 220383 URL: http://svn.freebsd.org/changeset/base/220383 Log: Add the scenarios used to show the premature "out of space" problem for Soft Updates, fixed in R220374. Added: projects/stress2/misc/linger.sh (contents, props changed) projects/stress2/misc/linger2.sh (contents, props changed) Added: projects/stress2/misc/linger.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/linger.sh Wed Apr 6 12:05:09 2011 (r220383) @@ -0,0 +1,166 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# Demonstrate premature "out of inodes" problem with SU + +. ../default.cfg + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > linger.c +cc -o linger -Wall -O2 linger.c +rm -f linger.c +cd $here + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 1g -u $mdstart +bsdlabel -w md$mdstart auto +[ $# -eq 1 ] && opt="$1" +[ $# -eq 0 ] && opt=-U # No argument == -U +echo "newfs $opt md${mdstart}$part" +newfs $opt md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint +chmod 777 $mntpoint + +if ! su ${testuser} -c "cd $mntpoint; /tmp/linger $size"; then + min=2 + [ -r $mntpoint/.sujournal ] && min=3 + r=`df -hi $mntpoint | head -1` + echo " $r" + for i in `jot 10`; do + r=`df -hi $mntpoint | tail -1` + echo "`date '+%T'` $r" + [ `echo $r | awk '{print $6}'` = $min ] && break + sleep 10 + done + ls -lR $mntpoint +fi + +while mount | grep "$mntpoint " | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +mdconfig -d -u $mdstart +rm -f /tmp/linger +exit +EOF +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PARALLEL 10 +static int size = 14130; /* 6 free inodes */ + +int +test(void) +{ + int error = 0, fd, i, j; + pid_t pid; + char file[128]; + + for (;;) { + if (access("rendezvous", R_OK) == 0) + break; + sched_yield(); + } + pid = getpid(); + for (j = 0; j < size; j++) { + sprintf(file,"p%05d.%05d", pid, j); + if ((fd = creat(file, 0660)) == -1) { + if (errno != EINTR) { + warn("creat(%s). %s:%d", file, __FILE__, __LINE__); + unlink("continue"); + error = 1; + break; + } + } + if (fd != -1 && close(fd) == -1) + err(2, "close(%d)", j); + + } + sleep(3); + + if (error == 0) + j--; + for (i = j; i >= 0; i--) { + sprintf(file,"p%05d.%05d", pid, i); + if (unlink(file) == -1) + err(3, "unlink(%s)", file); + + } + return (0); +} + +int +main(void) +{ + int error = 0, fd, i, j, status; + + umask(0); + if ((fd = open("continue", O_CREAT, 0644)) == -1) + err(1, "open()"); + close(fd); + for (i = 0; i < 100; i++) { + for (j = 0; j < PARALLEL; j++) { + if (fork() == 0) { + test(); + exit(0); + } + } + + if ((fd = open("rendezvous", O_CREAT, 0644)) == -1) + err(1, "open()"); + close(fd); + + for (j = 0; j < PARALLEL; j++) { + wait(&status); + error += status; + } + + unlink("rendezvous"); + if (access("continue", R_OK) == -1) { + fprintf(stderr, "Loop #%d\n", i + 1); + break; + } + } + unlink("continue"); + + return (error != 0); +} Added: projects/stress2/misc/linger2.sh ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/stress2/misc/linger2.sh Wed Apr 6 12:05:09 2011 (r220383) @@ -0,0 +1,176 @@ +#!/bin/sh + +# +# Copyright (c) 2011 Peter Holm +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# $FreeBSD$ +# + +[ `id -u ` -ne 0 ] && echo "Must be root!" && exit 1 + +# Variation of linger.sh, with emphasis on blocks. + +. ../default.cfg + +here=`pwd` +cd /tmp +sed '1,/^EOF/d' < $here/$0 > linger2.c +cc -o linger2 -Wall -O2 linger2.c +rm -f linger2.c +cd $here + +mount | grep $mntpoint | grep -q /dev/md && umount -f $mntpoint +mdconfig -l | grep -q md$mdstart && mdconfig -d -u $mdstart +mdconfig -a -t swap -s 1g -u $mdstart +bsdlabel -w md$mdstart auto +[ $# -eq 1 ] && opt="$1" +[ $# -eq 0 ] && opt=-U # The default is "-U" +echo "newfs $opt md${mdstart}$part" +newfs $opt md${mdstart}$part > /dev/null +mount /dev/md${mdstart}$part $mntpoint +chmod 777 $mntpoint + +min=24 +[ -r $mntpoint/.sujournal ] && { size=88; min=8232; } +if ! su ${testuser} -c "cd $mntpoint; /tmp/linger2 $size"; then + ls -lR $mntpoint + r=`df -i $mntpoint | head -1` + echo " $r" + for i in `jot 10`; do + r=`df -ik $mntpoint | tail -1` + echo "`date '+%T'` $r" + [ `echo $r | awk '{print $3}'` -le $min ] && break + sleep 10 + done +fi + +while mount | grep "$mntpoint " | grep -q /dev/md; do + umount $mntpoint || sleep 1 +done +mdconfig -d -u $mdstart +rm -f /tmp/linger2 +exit +EOF +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PARALLEL 10 +static int size = 89; + +int +test(void) +{ + int error = 0, fd, i, j; + pid_t pid; + char file[128]; + char *buf; + + for (;;) { + if (access("rendezvous", R_OK) == 0) + break; + sched_yield(); + } + pid = getpid(); + buf = malloc(1024 * 1024); + for (j = 0; j < size; j++) { + sprintf(file,"p%05d.%05d", pid, j); + if ((fd = creat(file, 0660)) == -1) { + if (errno != EINTR) { + warn("creat(%s). %s:%d", file, __FILE__, __LINE__); + unlink("continue"); + error = 1; + break; + } + } + if (write(fd, buf, 1024 * 1024) != 1024 * 1024) { + warn("write()"); + unlink("continue"); + error = 1; + break; + } + if (fd != -1 && close(fd) == -1) + err(2, "close(%d)", j); + + } + sleep(3); + + if (error == 0) + j--; + for (i = j; i >= 0; i--) { + sprintf(file,"p%05d.%05d", pid, i); + if (unlink(file) == -1) + warn("unlink(%s)", file); + + } + return (error); +} + +int +main(int argc, char **argv) +{ + int error = 0, fd, i, j, status; + + if (argc == 2) + size = atoi(argv[1]); + + umask(0); + if ((fd = open("continue", O_CREAT, 0644)) == -1) + err(1, "open()"); + close(fd); + for (i = 0; i < 200; i++) { + for (j = 0; j < PARALLEL; j++) { + if (fork() == 0) + exit(test()); + } + + if ((fd = open("rendezvous", O_CREAT, 0644)) == -1) + err(1, "open()"); + close(fd); + + for (j = 0; j < PARALLEL; j++) { + wait(&status); + error += status; + } + + unlink("rendezvous"); + if (access("continue", R_OK) == -1) { + fprintf(stderr, "Loop #%d\n", i + 1); + break; + } +// sleep(60); /* Debug */ + } + unlink("continue"); + + return (error != 0); +} From owner-svn-src-projects@FreeBSD.ORG Wed Apr 6 15:36:19 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 790CE1065672; Wed, 6 Apr 2011 15:36:19 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5F1958FC0C; Wed, 6 Apr 2011 15:36:19 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p36FaJoY095844; Wed, 6 Apr 2011 15:36:19 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p36FaJHP095839; Wed, 6 Apr 2011 15:36:19 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201104061536.p36FaJHP095839@svn.freebsd.org> From: Attilio Rao Date: Wed, 6 Apr 2011 15:36:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220384 - in projects/sv: etc/defaults etc/rc.d share/man/man5 X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Apr 2011 15:36:19 -0000 Author: attilio Date: Wed Apr 6 15:36:19 2011 New Revision: 220384 URL: http://svn.freebsd.org/changeset/base/220384 Log: Add rc.d script for netdumpsrv with related changes to rc.conf defaults. Reviewed by: dougb, emaste Added: projects/sv/etc/rc.d/netdumpsrv Modified: projects/sv/etc/defaults/rc.conf projects/sv/etc/rc.d/Makefile projects/sv/share/man/man5/rc.conf.5 Modified: projects/sv/etc/defaults/rc.conf ============================================================================== --- projects/sv/etc/defaults/rc.conf Wed Apr 6 12:05:09 2011 (r220383) +++ projects/sv/etc/defaults/rc.conf Wed Apr 6 15:36:19 2011 (r220384) @@ -286,6 +286,14 @@ named_auto_forward="NO" # Set up forwar named_auto_forward_only="NO" # Do "forward only" instead of "forward first" # +# netdumpsrv configuration. +# +netdumpsrv_enable="NO" # Run netdumpsrv. +netdumpsrv_program="/usr/sbin/netdumpsrv" # Path to netdumpsrv. +netdumpsrv_pidfile="/var/run/netdumpsrv.pid" # Path to pidfile for netdumpsrv. +#netdumpsrv_flags="" # Use this for flags -a, -D, -d, -i + +# # kerberos. Do not run the admin daemons on slave servers # kerberos5_server_enable="NO" # Run a kerberos 5 master server (or NO). Modified: projects/sv/etc/rc.d/Makefile ============================================================================== --- projects/sv/etc/rc.d/Makefile Wed Apr 6 12:05:09 2011 (r220383) +++ projects/sv/etc/rc.d/Makefile Wed Apr 6 15:36:19 2011 (r220384) @@ -22,7 +22,7 @@ FILES= DAEMON FILESYSTEMS LOGIN NETWORKI ldconfig local localpkg lockd lpd \ mixer motd mountcritlocal mountcritremote mountlate \ mdconfig mdconfig2 mountd moused mroute6d mrouted msgs \ - named natd netif netoptions \ + named natd netdumpsrv netif netoptions \ newsyslog nfsclient nfscbd nfsd \ nfsserver nfsuserd nisdomain nsswitch ntpd ntpdate \ othermta \ Added: projects/sv/etc/rc.d/netdumpsrv ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ projects/sv/etc/rc.d/netdumpsrv Wed Apr 6 15:36:19 2011 (r220384) @@ -0,0 +1,17 @@ +#!/bin/sh +# +# PROVIDE: netdumpsrv +# BEFORE: LOGIN +# KEYWORD: shutdown + +. /etc/rc.subr + +name="netdumpsrv" +rcvar=`set_rcvar` + +command="/usr/sbin/${name}" +pidfile="/var/run/${name}.pid" + +load_rc_config $name + +run_rc_command "$1" Modified: projects/sv/share/man/man5/rc.conf.5 ============================================================================== --- projects/sv/share/man/man5/rc.conf.5 Wed Apr 6 12:05:09 2011 (r220383) +++ projects/sv/share/man/man5/rc.conf.5 Wed Apr 6 15:36:19 2011 (r220384) @@ -1891,6 +1891,34 @@ Set to change the default forwarder conf .Dq forward first to .Dq forward only . +.It Va netdumpsrv_enable +.Pq Vt bool +If set to +.Dq Li YES , +run the +.Xr netdumpsrv 8 +daemon. +.It Va netdumpsrv_program +.Pq Vt str +Path to +.Xr netdumpsrv 8 +(default +.Pa /usr/sbin/netdumpsrv ) . +.It Va netdumpsrv_pidfile +.Pq Vt str +This is the default path to the +.Xr netdumpsrv 8 +daemon's PID file +(default +.Pa /usr/sbin/netdumpsrv.pid ) . +.It Va netdumpsrv_flags +.Pq Vt str +If +.Va netdumpsrv_enable +is set to +.Dq Li YES , +these are the flags to pass to +.Xr netdumpsrv 8 . .It Va kerberos5_server_enable .Pq Vt bool Set to From owner-svn-src-projects@FreeBSD.ORG Fri Apr 8 12:49:56 2011 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 99067106567E; Fri, 8 Apr 2011 12:49:56 +0000 (UTC) (envelope-from pho@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8AAF68FC13; Fri, 8 Apr 2011 12:49:56 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p38CnuCw080596; Fri, 8 Apr 2011 12:49:56 GMT (envelope-from pho@svn.freebsd.org) Received: (from pho@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p38Cnuwt080594; Fri, 8 Apr 2011 12:49:56 GMT (envelope-from pho@svn.freebsd.org) Message-Id: <201104081249.p38Cnuwt080594@svn.freebsd.org> From: Peter Holm Date: Fri, 8 Apr 2011 12:49:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r220450 - projects/stress2/lib X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 08 Apr 2011 12:49:56 -0000 Author: pho Date: Fri Apr 8 12:49:56 2011 New Revision: 220450 URL: http://svn.freebsd.org/changeset/base/220450 Log: arc4random(3) preserves state across fork(2), so a stir is needed. While here mark unused arguments. Modified: projects/stress2/lib/main.c Modified: projects/stress2/lib/main.c ============================================================================== --- projects/stress2/lib/main.c Fri Apr 8 12:46:47 2011 (r220449) +++ projects/stress2/lib/main.c Fri Apr 8 12:49:56 2011 (r220450) @@ -52,7 +52,7 @@ char *home; static pid_t *r; void -handler(int i) +handler(int i __unused) { int j; @@ -77,14 +77,14 @@ handler(int i) } void -run_test_handler(int i) +run_test_handler(int i __unused) { done_testing = 1; } void -exit_handler(int i) +exit_handler(int i __unused) { exit(1); @@ -106,6 +106,7 @@ run_tests(int i) signal(SIGHUP, run_test_handler); signal(SIGINT, exit_handler); atexit(callcleanup); + arc4random_stir(); setup(i); if ((strcmp(getprogname(), "run") != 0) && (op->nodelay == 0)) sleep(random_int(1,10));