Date: Sat, 15 Oct 2005 01:23:19 GMT From: "George V. Neville-Neil" <gnn@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 85324 for review Message-ID: <200510150123.j9F1NJVa009146@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=85324 Change 85324 by gnn@fast_ipsec_integ on 2005/10/15 01:22:36 Integration from HEAD Affected files ... .. //depot/projects/fast_ipsec/src/sys/alpha/alpha/machdep.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/alpha/alpha/trap.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/alpha/linux/linux_sysvec.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/alpha/osf1/osf1_signal.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/alpha/osf1/osf1_signal.h#2 integrate .. //depot/projects/fast_ipsec/src/sys/amd64/amd64/identcpu.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/amd64/amd64/initcpu.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/amd64/amd64/machdep.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/amd64/amd64/trap.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/amd64/conf/NOTES#3 integrate .. //depot/projects/fast_ipsec/src/sys/amd64/ia32/ia32_signal.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/amd64/ia32/ia32_syscall.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/amd64/include/md_var.h#2 integrate .. //depot/projects/fast_ipsec/src/sys/amd64/include/specialreg.h#2 integrate .. //depot/projects/fast_ipsec/src/sys/amd64/linux32/linux32_sysvec.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/arm/arm/machdep.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/arm/arm/trap.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/arm/arm/undefined.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/arm/include/atomic.h#3 integrate .. //depot/projects/fast_ipsec/src/sys/compat/ia32/ia32_signal.h#2 integrate .. //depot/projects/fast_ipsec/src/sys/compat/linux/linux_misc.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/compat/svr4/svr4_signal.h#2 integrate .. //depot/projects/fast_ipsec/src/sys/conf/files#3 integrate .. //depot/projects/fast_ipsec/src/sys/conf/kmod.mk#3 integrate .. //depot/projects/fast_ipsec/src/sys/conf/options#3 integrate .. //depot/projects/fast_ipsec/src/sys/dev/aac/aac.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/dev/aac/aacreg.h#3 integrate .. //depot/projects/fast_ipsec/src/sys/dev/pccard/pccarddevs#3 integrate .. //depot/projects/fast_ipsec/src/sys/dev/re/if_re.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/dev/sx/cd1865.h#2 delete .. //depot/projects/fast_ipsec/src/sys/dev/sx/sx.c#2 delete .. //depot/projects/fast_ipsec/src/sys/dev/sx/sx.h#2 delete .. //depot/projects/fast_ipsec/src/sys/dev/sx/sx_pci.c#2 delete .. //depot/projects/fast_ipsec/src/sys/dev/sx/sx_util.c#2 delete .. //depot/projects/fast_ipsec/src/sys/dev/sx/sx_util.h#2 delete .. //depot/projects/fast_ipsec/src/sys/dev/sx/sxvar.h#2 delete .. //depot/projects/fast_ipsec/src/sys/dev/wi/if_wi_pccard.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/fs/nwfs/nwfs_vfsops.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/fs/procfs/procfs_ctl.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/fs/smbfs/smbfs_vfsops.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/i386/conf/NOTES#3 integrate .. //depot/projects/fast_ipsec/src/sys/i386/i386/identcpu.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/i386/i386/initcpu.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/i386/i386/machdep.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/i386/i386/trap.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/i386/include/md_var.h#2 integrate .. //depot/projects/fast_ipsec/src/sys/i386/include/specialreg.h#2 integrate .. //depot/projects/fast_ipsec/src/sys/i386/linux/linux_sysvec.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/i386/svr4/svr4_machdep.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/ia64/ia32/ia32_signal.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/ia64/ia32/ia32_trap.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/ia64/ia64/machdep.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/ia64/ia64/trap.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/kern/init_sysent.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/kern/kern_exec.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/kern/kern_exit.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/kern/kern_kse.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/kern/kern_sig.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/kern/kern_thr.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/kern/kern_thread.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/kern/subr_param.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/kern/subr_trap.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/kern/syscalls.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/kern/syscalls.master#3 integrate .. //depot/projects/fast_ipsec/src/sys/kern/vfs_subr.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/modules/3dfx/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/Makefile#3 integrate .. //depot/projects/fast_ipsec/src/sys/modules/acpi/acpi/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/aha/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/ahb/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/an/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/ar/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/arcnet/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/arl/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/awi/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/bktr/bktr/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/cam/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/coda5/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/cp/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/ctau/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/cx/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/dcons/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/digi/digi/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/en/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/fatm/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/firewire/fwip/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/hatm/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/hifn/Makefile#3 integrate .. //depot/projects/fast_ipsec/src/sys/modules/if_bridge/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/if_disc/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/if_ef/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/if_faith/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/if_gif/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/if_gre/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/if_ppp/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/if_sl/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/if_stf/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/if_tap/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/if_tun/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/if_vlan/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/ip_mroute_mod/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/ipfilter/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/kbdmux/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/linux/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/netgraph/gif/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/netgraph/iface/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/netgraph/mppc/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/netgraph/sync_ar/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/netgraph/sync_sr/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/nfs4client/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/nfsclient/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/nfsserver/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/nmdm/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/nwfs/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/osf1/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/patm/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/pf/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/rc/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/rp/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/safe/Makefile#3 integrate .. //depot/projects/fast_ipsec/src/sys/modules/sio/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/smbfs/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/snc/Makefile#3 integrate .. //depot/projects/fast_ipsec/src/sys/modules/sppp/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/sr/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/svr4/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/trm/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/ubsec/Makefile#3 integrate .. //depot/projects/fast_ipsec/src/sys/modules/ukbd/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/vkbd/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/wi/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/modules/wlan/Makefile#2 integrate .. //depot/projects/fast_ipsec/src/sys/net/if_bridge.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/netgraph/ng_mppc.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/pc98/conf/NOTES#3 integrate .. //depot/projects/fast_ipsec/src/sys/pc98/pc98/machdep.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/pci/if_rlreg.h#3 integrate .. //depot/projects/fast_ipsec/src/sys/pci/if_sk.c#3 integrate .. //depot/projects/fast_ipsec/src/sys/pci/if_skreg.h#2 integrate .. //depot/projects/fast_ipsec/src/sys/powerpc/powerpc/machdep.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/powerpc/powerpc/trap.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/sparc64/include/param.h#2 integrate .. //depot/projects/fast_ipsec/src/sys/sparc64/sparc64/machdep.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/sparc64/sparc64/trap.c#2 integrate .. //depot/projects/fast_ipsec/src/sys/sys/proc.h#3 integrate .. //depot/projects/fast_ipsec/src/sys/sys/signalvar.h#3 integrate .. //depot/projects/fast_ipsec/src/sys/sys/syscall.h#3 integrate .. //depot/projects/fast_ipsec/src/sys/sys/syscall.mk#3 integrate .. //depot/projects/fast_ipsec/src/sys/sys/sysent.h#2 integrate .. //depot/projects/fast_ipsec/src/sys/sys/sysproto.h#3 integrate .. //depot/projects/fast_ipsec/src/sys/ufs/ufs/ufs_lookup.c#2 integrate Differences ... ==== //depot/projects/fast_ipsec/src/sys/alpha/alpha/machdep.c#2 (text+ko) ==== @@ -88,7 +88,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.235 2005/04/04 21:53:51 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/machdep.c,v 1.236 2005/10/14 12:43:42 davidxu Exp $"); #include "opt_compat.h" #include "opt_ddb.h" @@ -211,11 +211,10 @@ #define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2) #ifdef COMPAT_43 -void osendsig(sig_t catcher, int sig, sigset_t *mask, u_long code); +void osendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); #endif #ifdef COMPAT_FREEBSD4 -static void freebsd4_sendsig(sig_t catcher, int sig, sigset_t *mask, - u_long code); +static void freebsd4_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask); #endif static void get_fpcontext(struct thread *td, mcontext_t *mcp); @@ -1107,7 +1106,7 @@ */ #ifdef COMPAT_43 void -osendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) +osendsig(sig_t catcher, ksiginfo_t *kp, sigset_t *mask) { struct proc *p; struct thread *td; @@ -1115,10 +1114,14 @@ struct trapframe *frame; struct sigacts *psp; int oonstack, fsize, rndfsize; + int sig; + int code; td = curthread; p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); + sig = kp->ksi_signo; + code = kp->ksi_code; psp = p->p_sigacts; mtx_assert(&psp->ps_mtx, MA_OWNED); @@ -1177,7 +1180,7 @@ /* Fill in POSIX parts */ ksi.si_signo = sig; ksi.si_code = code; - ksi.si_value.sigval_ptr = NULL; /* XXX */ + ksi.si_value = kp->ksi_value; /* * copy the frame out to userland. @@ -1212,7 +1215,7 @@ #ifdef COMPAT_FREEBSD4 static void -freebsd4_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) +freebsd4_sendsig(sig_t catcher, ksiginfo_t *kp, sigset_t *mask) { struct proc *p; struct thread *td; @@ -1220,10 +1223,14 @@ struct sigacts *psp; struct sigframe4 sf, *sfp; int oonstack, rndfsize; + int sig; + int code; td = curthread; p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); + sig = kp->ksi_signo; + code = kp->ksi_code; psp = p->p_sigacts; mtx_assert(&psp->ps_mtx, MA_OWNED); @@ -1308,9 +1315,7 @@ frame->tf_regs[FRAME_A1] = (u_int64_t)&(sfp->sf_si); /* Fill in POSIX parts */ - sf.sf_si.si_signo = sig; - sf.sf_si.si_code = code; - sf.sf_si.si_addr = (void*)frame->tf_regs[FRAME_TRAPARG_A0]; + sf.sf_si = kp->ksi_info; } else frame->tf_regs[FRAME_A1] = code; @@ -1323,7 +1328,7 @@ #endif /* COMPAT_FREEBSD4 */ void -sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) +sendsig(sig_t catcher, ksiginfo_t *kp, sigset_t *mask) { struct proc *p; struct thread *td; @@ -1331,21 +1336,25 @@ struct sigacts *psp; struct sigframe sf, *sfp; int oonstack, rndfsize; + int sig; + int code; td = curthread; p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); + sig = kp->ksi_signo; + code = kp->ksi_code; psp = p->p_sigacts; mtx_assert(&psp->ps_mtx, MA_OWNED); #ifdef COMPAT_FREEBSD4 if (SIGISMEMBER(psp->ps_freebsd4, sig)) { - freebsd4_sendsig(catcher, sig, mask, code); + freebsd4_sendsig(catcher, kp, mask); return; } #endif #ifdef COMPAT_43 if (SIGISMEMBER(psp->ps_osigset, sig)) { - osendsig(catcher, sig, mask, code); + osendsig(catcher, kp, mask); return; } #endif @@ -1432,9 +1441,7 @@ frame->tf_regs[FRAME_A1] = (u_int64_t)&(sfp->sf_si); /* Fill in POSIX parts */ - sf.sf_si.si_signo = sig; - sf.sf_si.si_code = code; - sf.sf_si.si_addr = (void*)frame->tf_regs[FRAME_TRAPARG_A0]; + sf.sf_si = kp->ksi_info; } else frame->tf_regs[FRAME_A1] = code; @@ -1446,25 +1453,6 @@ } /* - * Build siginfo_t for SA thread - */ -void -cpu_thread_siginfo(int sig, u_long code, siginfo_t *si) -{ - struct proc *p; - struct thread *td; - - td = curthread; - p = td->td_proc; - PROC_LOCK_ASSERT(p, MA_OWNED); - - bzero(si, sizeof(*si)); - si->si_signo = sig; - si->si_code = code; - /* XXXKSE fill other fields */ -} - -/* * System call to cleanup state after a signal * has been taken. Reset signal mask and * stack state from context left by sendsig (above). ==== //depot/projects/fast_ipsec/src/sys/alpha/alpha/trap.c#3 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/alpha/trap.c,v 1.125 2005/09/28 07:03:01 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/alpha/trap.c,v 1.126 2005/10/14 12:43:42 davidxu Exp $"); /* #include "opt_fix_unaligned_vax_fp.h" */ #include "opt_ddb.h" @@ -264,6 +264,7 @@ #ifdef SMP register_t s; #endif + ksiginfo_t ksi; /* * Find our per-cpu globals. @@ -585,7 +586,12 @@ framep->tf_regs[FRAME_TRAPARG_A0] = a0; framep->tf_regs[FRAME_TRAPARG_A1] = a1; framep->tf_regs[FRAME_TRAPARG_A2] = a2; - trapsignal(td, i, ucode); + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = i; + ksi.ksi_code = ucode; /* XXX, Should be POSIX si_code */ + ksi.ksi_addr = (void *)a0; + trapsignal(td, &ksi); + out: if (user) { framep->tf_regs[FRAME_SP] = alpha_pal_rdusp(); ==== //depot/projects/fast_ipsec/src/sys/alpha/linux/linux_sysvec.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/linux/linux_sysvec.c,v 1.95 2005/07/29 19:40:38 jhb Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/linux/linux_sysvec.c,v 1.96 2005/10/14 12:43:43 davidxu Exp $"); /* XXX we use functions that might not exist. */ #include "opt_compat.h" @@ -77,7 +77,7 @@ SET_DECLARE(linux_ioctl_handler_set, struct linux_ioctl_handler); -void osendsig(sig_t catcher, int sig, sigset_t *mask, u_long code); +void osendsig(sig_t catcher, ksiginfo_t *kp, sigset_t *mask); static int elf_linux_fixup(register_t **stack_base, struct image_params *iparams); ==== //depot/projects/fast_ipsec/src/sys/alpha/osf1/osf1_signal.c#3 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/alpha/osf1/osf1_signal.c,v 1.42 2005/09/28 07:03:01 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/alpha/osf1/osf1_signal.c,v 1.43 2005/10/14 12:43:43 davidxu Exp $"); #include "opt_compat.h" #ifndef COMPAT_43 @@ -459,7 +459,7 @@ */ void -osf1_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) +osf1_sendsig(sig_t catcher, ksiginfo_t *kp, sigset_t *mask) { int fsize, oonstack, rndfsize; struct thread *td; @@ -467,10 +467,14 @@ osiginfo_t *sip, ksi; struct trapframe *frame; struct sigacts *psp; + int sig; + int code; td = curthread; p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); + sig = kp->ksi_signo; + code = kp->ksi_code; psp = p->p_sigacts; mtx_assert(&psp->ps_mtx, MA_OWNED); @@ -526,7 +530,7 @@ /* Fill in POSIX parts */ ksi.si_signo = sig; ksi.si_code = code; - ksi.si_value.sigval_ptr = NULL; /* XXX */ + ksi.si_value = kp->ksi_value; /* * copy the frame out to userland. ==== //depot/projects/fast_ipsec/src/sys/alpha/osf1/osf1_signal.h#2 (text+ko) ==== @@ -1,4 +1,4 @@ -/* $FreeBSD: src/sys/alpha/osf1/osf1_signal.h,v 1.3 2002/03/20 18:58:46 obrien Exp $ */ +/* $FreeBSD: src/sys/alpha/osf1/osf1_signal.h,v 1.4 2005/10/14 12:43:43 davidxu Exp $ */ #ifndef _OSF1_SIGNAL_H #define _OSF1_SIGNAL_H @@ -61,7 +61,7 @@ void bsd_to_osf1_sigset(const sigset_t *, osf1_sigset_t *); void osf1_to_bsd_sigaltstack(const struct osf1_sigaltstack *, struct sigaltstack *); void osf1_to_bsd_sigset(const osf1_sigset_t *, sigset_t *); -void osf1_sendsig(sig_t, int , sigset_t *, u_long ); +void osf1_sendsig(sig_t, struct ksiginfo *, sigset_t *); #endif /* !_OSF1_SIGNAL_H */ ==== //depot/projects/fast_ipsec/src/sys/amd64/amd64/identcpu.c#2 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.136 2005/05/29 17:43:23 schweikh Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/identcpu.c,v 1.137 2005/10/14 22:52:00 jkim Exp $"); #include "opt_cpu.h" @@ -165,6 +165,8 @@ strcmp(cpu_vendor, "AuthenticAMD") == 0) { printf(" Stepping = %u", cpu_id & 0xf); if (cpu_high > 0) { + u_int cmp = 1, htt = 1; + /* * Here we should probably set up flags indicating * whether or not various features are available. @@ -246,6 +248,16 @@ "\040<b31>" ); } + + /* + * AMD64 Architecture Programmer's Manual Volume 3: + * General-Purpose and System Instructions + * http://www.amd.com/us-en/assets/content_type/white_papers_and_tech_docs/24594.pdf + * + * IA-32 Intel Architecture Software Developer's Manual, + * Volume 2A: Instruction Set Reference, A-M + * ftp://download.intel.com/design/Pentium4/manuals/25366617.pdf + */ if (amd_feature != 0) { printf("\n AMD Features=0x%b", amd_feature, "\020" /* in hex */ @@ -274,9 +286,9 @@ "\027MMX+" /* AMD MMX Extensions */ "\030<s23>" /* Same */ "\031<s24>" /* Same */ - "\032<b25>" /* Undefined */ + "\032FFXSR" /* Fast FXSAVE/FXRSTOR */ "\033<b26>" /* Undefined */ - "\034<b27>" /* Undefined */ + "\034RDTSCP" /* RDTSCP */ "\035<b28>" /* Undefined */ "\036LM" /* 64 bit long mode */ "\0373DNow+" /* AMD 3DNow! Extensions */ @@ -284,14 +296,61 @@ ); } + if (amd_feature2 != 0) { + printf("\n AMD Features2=0x%b", amd_feature2, + "\020" + "\001LAHF" /* LAHF/SAHF in long mode */ + "\002CMP" /* CMP legacy */ + "\003<b2>" + "\004<b3>" + "\005CR8" /* CR8 in legacy mode */ + "\006<b5>" + "\007<b6>" + "\010<b7>" + "\011<b8>" + "\012<b9>" + "\013<b10>" + "\014<b11>" + "\015<b12>" + "\016<b13>" + "\017<b14>" + "\020<b15>" + "\021<b16>" + "\022<b17>" + "\023<b18>" + "\024<b19>" + "\025<b20>" + "\026<b21>" + "\027<b22>" + "\030<b23>" + "\031<b24>" + "\032<b25>" + "\033<b26>" + "\034<b27>" + "\035<b28>" + "\036<b29>" + "\037<b30>" + "\040<b31>" + ); + } + /* - * If this CPU supports hyperthreading then mention - * the number of logical CPU's it contains. + * If this CPU supports HTT or CMP then mention the + * number of physical/logical cores it contains. */ - if (cpu_feature & CPUID_HTT && - (cpu_procinfo & CPUID_HTT_CORES) >> 16 > 1) - printf("\n Hyperthreading: %d logical CPUs", - (cpu_procinfo & CPUID_HTT_CORES) >> 16); + if (cpu_feature & CPUID_HTT) + htt = (cpu_procinfo & CPUID_HTT_CORES) >> 16; + if (strcmp(cpu_vendor, "AuthenticAMD") == 0 && + (amd_feature2 & AMDID2_CMP)) + cmp = (cpu_procinfo2 & AMDID_CMP_CORES) + 1; + else if (strcmp(cpu_vendor, "GenuineIntel") == 0 && + (cpu_high >= 4)) { + cpuid_count(4, 0, regs); + cmp = ((regs[0] & 0xfc000000) >> 26) + 1; + } + if (htt > 1) + printf("\n Physical/Logical cores: %d/%d", + cmp, htt); } } /* Avoid ugly blank lines: only print newline when we have to. */ @@ -357,6 +416,11 @@ if (cpu_exthigh >= 0x80000001) { do_cpuid(0x80000001, regs); amd_feature = regs[3] & ~(cpu_feature & 0x0183f3ff); + amd_feature2 = regs[2]; + } + if (cpu_exthigh >= 0x80000008) { + do_cpuid(0x80000008, regs); + cpu_procinfo2 = regs[2]; } /* XXX */ ==== //depot/projects/fast_ipsec/src/sys/amd64/amd64/initcpu.c#2 (text+ko) ==== @@ -28,7 +28,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/initcpu.c,v 1.48 2004/06/08 01:02:51 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/initcpu.c,v 1.49 2005/10/14 22:52:00 jkim Exp $"); #include "opt_cpu.h" @@ -51,11 +51,13 @@ int cpu; /* Are we 386, 386sx, 486, etc? */ u_int cpu_feature; /* Feature flags */ u_int cpu_feature2; /* Feature flags */ -u_int amd_feature; /* Feature flags */ +u_int amd_feature; /* AMD feature flags */ +u_int amd_feature2; /* AMD feature flags */ u_int cpu_high; /* Highest arg to CPUID */ u_int cpu_exthigh; /* Highest arg to extended CPUID */ u_int cpu_id; /* Stepping ID */ u_int cpu_procinfo; /* HyperThreading Info / Brand Index / CLFUSH */ +u_int cpu_procinfo2; /* Multicore info */ char cpu_vendor[20]; /* CPU Origin code */ u_int cpu_fxsr; /* SSE enabled */ ==== //depot/projects/fast_ipsec/src/sys/amd64/amd64/machdep.c#3 (text+ko) ==== @@ -39,7 +39,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.640 2005/09/27 18:15:57 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.641 2005/10/14 12:43:43 davidxu Exp $"); #include "opt_atalk.h" #include "opt_atpic.h" @@ -237,11 +237,7 @@ * specified pc, psl. */ void -sendsig(catcher, sig, mask, code) - sig_t catcher; - int sig; - sigset_t *mask; - u_long code; +sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) { struct sigframe sf, *sfp; struct proc *p; @@ -250,10 +246,12 @@ char *sp; struct trapframe *regs; int oonstack; + int sig; 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; @@ -297,13 +295,13 @@ sf.sf_ahu.sf_action = (__siginfohandler_t *)catcher; /* Fill in POSIX parts */ - sf.sf_si.si_signo = sig; - sf.sf_si.si_code = code; - regs->tf_rcx = regs->tf_addr; /* arg 4 in %rcx */ + sf.sf_si = ksi->ksi_info; + sf.sf_si.si_signo = sig; /* maybe a translated signal */ + regs->tf_rcx = (register_t)ksi->ksi_addr; /* arg 4 in %rcx */ } else { /* Old FreeBSD-style arguments. */ - regs->tf_rsi = code; /* arg 2 in %rsi */ - regs->tf_rcx = regs->tf_addr; /* arg 4 in %rcx */ + regs->tf_rsi = ksi->ksi_code; /* arg 2 in %rsi */ + regs->tf_rcx = (register_t)ksi->ksi_addr; /* arg 4 in %rcx */ sf.sf_ahu.sf_handler = catcher; } mtx_unlock(&psp->ps_mtx); @@ -329,28 +327,6 @@ } /* - * Build siginfo_t for SA thread - */ -void -cpu_thread_siginfo(int sig, u_long code, siginfo_t *si) -{ - struct proc *p; - struct thread *td; - struct trapframe *regs; - - td = curthread; - p = td->td_proc; - regs = td->td_frame; - PROC_LOCK_ASSERT(p, MA_OWNED); - - bzero(si, sizeof(*si)); - si->si_signo = sig; - si->si_code = code; - si->si_addr = (void *)regs->tf_addr; - /* XXXKSE fill other fields */ -} - -/* * System call to cleanup state after a signal * has been taken. Reset signal mask and * stack state from context left by sendsig (above). @@ -374,6 +350,7 @@ const ucontext_t *ucp; long rflags; int cs, error, ret; + ksiginfo_t ksi; error = copyin(uap->sigcntxp, &uc, sizeof(uc)); if (error != 0) @@ -407,7 +384,12 @@ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { printf("sigreturn: cs = 0x%x\n", cs); - trapsignal(td, SIGBUS, T_PROTFLT); + 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); } ==== //depot/projects/fast_ipsec/src/sys/amd64/amd64/trap.c#3 (text+ko) ==== @@ -38,7 +38,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.294 2005/10/01 18:56:16 glebius Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/trap.c,v 1.295 2005/10/14 12:43:43 davidxu Exp $"); /* * AMD64 Trap and System call handling @@ -161,6 +161,8 @@ struct proc *p = td->td_proc; u_int sticks = 0; int i = 0, ucode = 0, type, code; + register_t addr = 0; + ksiginfo_t ksi; PCPU_LAZY_INC(cnt.v_trap); type = frame.tf_trapno; @@ -241,13 +243,14 @@ sticks = td->td_sticks; td->td_frame = &frame; + addr = frame.tf_rip; if (td->td_ucred != p->p_ucred) cred_update_thread(td); switch (type) { case T_PRIVINFLT: /* privileged instruction fault */ - ucode = type; i = SIGILL; + ucode = ILL_PRVOPC; break; case T_BPTFLT: /* bpt instruction fault */ @@ -255,6 +258,7 @@ enable_intr(); frame.tf_rflags &= ~PSL_T; i = SIGTRAP; + ucode = (type == T_TRCTRAP ? TRAP_TRACE : TRAP_BRKPT); break; case T_ARITHTRAP: /* arithmetic trap */ @@ -265,16 +269,26 @@ break; case T_PROTFLT: /* general protection fault */ + i = SIGBUS; + ucode = BUS_OBJERR; + break; case T_STKFLT: /* stack fault */ case T_SEGNPFLT: /* segment not present fault */ + i = SIGBUS; + ucode = BUS_ADRERR; + break; case T_TSSFLT: /* invalid TSS fault */ + i = SIGBUS; + ucode = BUS_OBJERR; + break; case T_DOUBLEFLT: /* double fault */ default: - ucode = code + BUS_SEGM_FAULT ; i = SIGBUS; + ucode = BUS_OBJERR; break; case T_PAGEFLT: /* page fault */ + addr = frame.tf_addr; if (td->td_pflags & TDP_SA) thread_user_enter(td); i = trap_pfault(&frame, TRUE); @@ -283,7 +297,12 @@ if (i == 0) goto user; - ucode = T_PAGEFLT; + if (i == SIGSEGV) + ucode = SEGV_MAPERR; + else { + i = SIGSEGV; /* XXX hack */ + ucode = SEGV_ACCERR; + } break; case T_DIVIDE: /* integer divide fault */ @@ -326,12 +345,14 @@ /* transparent fault (due to context switch "late") */ if (fpudna()) goto userout; - i = SIGFPE; - ucode = FPE_FPU_NP_TRAP; + printf("pid %d killed due to lack of floating point\n", + p->p_pid); + i = SIGKILL; + ucode = 0; break; case T_FPOPFLT: /* FPU operand fetch fault */ - ucode = T_FPOPFLT; + ucode = ILL_COPROC; i = SIGILL; break; @@ -472,7 +493,12 @@ if (*p->p_sysent->sv_transtrap) i = (*p->p_sysent->sv_transtrap)(i, type); - trapsignal(td, i, ucode); + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = i; + ksi.ksi_code = ucode; + ksi.ksi_trapno = type; + ksi.ksi_addr = (void *)addr; + trapsignal(td, &ksi); #ifdef DEBUG if (type <= MAX_TRAP_MSG) { @@ -696,6 +722,7 @@ register_t *argp; u_int code; int reg, regcnt; + ksiginfo_t ksi; /* * note: PCPU_LAZY_INC() can only be used if we can afford @@ -826,7 +853,12 @@ */ if (orig_tf_rflags & PSL_T) { frame.tf_rflags &= ~PSL_T; - trapsignal(td, SIGTRAP, 0); + + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGTRAP; + ksi.ksi_code = TRAP_TRACE; + ksi.ksi_addr = (void *)frame.tf_rip; + trapsignal(td, &ksi); } /* ==== //depot/projects/fast_ipsec/src/sys/amd64/conf/NOTES#3 (text+ko) ==== @@ -4,7 +4,7 @@ # This file contains machine dependent kernel configuration notes. For # machine independent notes, look in /sys/conf/NOTES. # -# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.43 2005/10/07 09:23:51 glebius Exp $ +# $FreeBSD: src/sys/amd64/conf/NOTES,v 1.44 2005/10/14 17:22:28 ru Exp $ # # @@ -235,9 +235,9 @@ device ath device ath_hal # Atheros HAL (includes binary component) -device ath_rate_onoe # Onoe rate control for ath driver #device ath_rate_amrr # AMRR rate control for ath driver -#device ath_rate_sample # SampleRate rate control for the ath driver +#device ath_rate_onoe # Onoe rate control for ath driver +device ath_rate_sample # SampleRate rate control for the ath driver #device wlan # 802.11 layer # ==== //depot/projects/fast_ipsec/src/sys/amd64/ia32/ia32_signal.c#3 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.11 2005/09/27 18:04:20 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/ia32/ia32_signal.c,v 1.12 2005/10/14 12:43:43 davidxu Exp $"); #include "opt_compat.h" @@ -79,7 +79,7 @@ #include <machine/cpufunc.h> #ifdef COMPAT_FREEBSD4 -static void freebsd4_ia32_sendsig(sig_t, int, sigset_t *, u_long); +static void freebsd4_ia32_sendsig(sig_t, ksiginfo_t *, sigset_t *); #endif static void ia32_get_fpcontext(struct thread *td, struct ia32_mcontext *mcp); static int ia32_set_fpcontext(struct thread *td, const struct ia32_mcontext *mcp); @@ -295,18 +295,23 @@ */ #ifdef COMPAT_FREEBSD4 static void -freebsd4_ia32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) +freebsd4_ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) { struct ia32_sigframe4 sf, *sfp; + struct ia32_siginfo siginfo; struct proc *p; struct thread *td; struct sigacts *psp; struct trapframe *regs; int oonstack; + int sig; td = curthread; p = td->td_proc; + siginfo_to_ia32siginfo(&ksi->ksi_info, &siginfo); + PROC_LOCK_ASSERT(p, MA_OWNED); + sig = siginfo.si_signo; psp = p->p_sigacts; mtx_assert(&psp->ps_mtx, MA_OWNED); regs = td->td_frame; @@ -362,13 +367,12 @@ sf.sf_ah = (u_int32_t)(uintptr_t)catcher; /* Fill in POSIX parts */ + sf.sf_si = siginfo; sf.sf_si.si_signo = sig; - sf.sf_si.si_code = code; - sf.sf_si.si_addr = regs->tf_addr; } else { /* Old FreeBSD-style arguments. */ - sf.sf_siginfo = code; - sf.sf_addr = regs->tf_addr; + sf.sf_siginfo = siginfo.si_code; + sf.sf_addr = (u_int32_t)siginfo.si_addr; sf.sf_ah = (u_int32_t)(uintptr_t)catcher; } mtx_unlock(&psp->ps_mtx); @@ -400,23 +404,27 @@ #endif /* COMPAT_FREEBSD4 */ void -ia32_sendsig(sig_t catcher, int sig, sigset_t *mask, u_long code) +ia32_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask) { struct ia32_sigframe sf, *sfp; + struct ia32_siginfo siginfo; struct proc *p; struct thread *td; struct sigacts *psp; char *sp; struct trapframe *regs; int oonstack; + int sig; + siginfo_to_ia32siginfo(&ksi->ksi_info, &siginfo); td = curthread; p = td->td_proc; PROC_LOCK_ASSERT(p, MA_OWNED); + sig = siginfo.si_signo; psp = p->p_sigacts; #ifdef COMPAT_FREEBSD4 if (SIGISMEMBER(psp->ps_freebsd4, sig)) { - freebsd4_ia32_sendsig(catcher, sig, mask, code); + freebsd4_ia32_sendsig(catcher, ksi, mask); return; } #endif @@ -479,13 +487,12 @@ sf.sf_ah = (u_int32_t)(uintptr_t)catcher; /* Fill in POSIX parts */ + sf.sf_si = siginfo; sf.sf_si.si_signo = sig; - sf.sf_si.si_code = code; - sf.sf_si.si_addr = regs->tf_addr; } else { /* Old FreeBSD-style arguments. */ - sf.sf_siginfo = code; - sf.sf_addr = regs->tf_addr; + sf.sf_siginfo = siginfo.si_code; + sf.sf_addr = (u_int32_t)siginfo.si_addr; sf.sf_ah = (u_int32_t)(uintptr_t)catcher; } mtx_unlock(&psp->ps_mtx); @@ -540,6 +547,7 @@ struct trapframe *regs; const struct ia32_ucontext4 *ucp; int cs, eflags, error; + ksiginfo_t ksi; error = copyin(uap->sigcntxp, &uc, sizeof(uc)); if (error != 0) @@ -573,7 +581,12 @@ cs = ucp->uc_mcontext.mc_cs; if (!CS_SECURE(cs)) { printf("freebsd4_sigreturn: cs = 0x%x\n", cs); - trapsignal(td, SIGBUS, T_PROTFLT); + ksiginfo_init_trap(&ksi); + ksi.ksi_signo = SIGBUS; >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200510150123.j9F1NJVa009146>