svn commit: r205636 - head/sys/netgraph/netflow

2010-03-25 Thread Gleb Smirnoff
Author: glebius
Date: Thu Mar 25 10:13:21 2010
New Revision: 205636
URL: http://svn.freebsd.org/changeset/base/205636

Log:
  Remove disabled code. In 99% cases exports are send to ng_ksocket(4), which
  already forces queued mode, so what was suggested in disabled code is already
  done.

Modified:
  head/sys/netgraph/netflow/ng_netflow.c

Modified: head/sys/netgraph/netflow/ng_netflow.c
==
--- head/sys/netgraph/netflow/ng_netflow.c  Thu Mar 25 08:33:56 2010
(r205635)
+++ head/sys/netgraph/netflow/ng_netflow.c  Thu Mar 25 10:13:21 2010
(r205636)
@@ -286,15 +286,6 @@ ng_netflow_newhook(node_p node, hook_p h
 
priv-export = hook;
 
-#if 0  /* TODO: profile  test first */
-   /*
-* We send export dgrams in interrupt handlers and in
-* callout threads. We'd better queue data for later
-* netgraph ISR processing.
-*/
-   NG_HOOK_FORCE_QUEUE(NG_HOOK_PEER(hook));
-#endif
-
/* Exporter is ready. Let's schedule expiry. */
callout_reset(priv-exp_callout, (1*hz), ng_netflow_expire,
(void *)priv);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205637 - head/sys/netinet6

2010-03-25 Thread Bjoern A. Zeeb
Author: bz
Date: Thu Mar 25 10:29:00 2010
New Revision: 205637
URL: http://svn.freebsd.org/changeset/base/205637

Log:
  We are holding a write lock here so avoid aquiring it twice calling
  the locked version rather than the wrapper function.
  
  MFC after:6 days

Modified:
  head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Thu Mar 25 10:13:21 2010(r205636)
+++ head/sys/netinet6/nd6.c Thu Mar 25 10:29:00 2010(r205637)
@@ -1168,7 +1168,7 @@ nd6_nud_hint(struct rtentry *rt, struct 
 
ln-ln_state = ND6_LLINFO_REACHABLE;
if (!ND6_LLINFO_PERMANENT(ln)) {
-   nd6_llinfo_settimer(ln,
+   nd6_llinfo_settimer_locked(ln,
(long)ND_IFINFO(rt-rt_ifp)-reachable * hz);
}
 done:
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205640 - head/sys/conf

2010-03-25 Thread Alexander Leidinger
Author: netchild
Date: Thu Mar 25 13:47:21 2010
New Revision: 205640
URL: http://svn.freebsd.org/changeset/base/205640

Log:
  Propagate CONF_CFLAGS (from makeoptions) to the module build too.
  
  Discussed with:   jhb (on arch@)

Modified:
  head/sys/conf/kern.post.mk
  head/sys/conf/kmod.mk

Modified: head/sys/conf/kern.post.mk
==
--- head/sys/conf/kern.post.mk  Thu Mar 25 13:15:55 2010(r205639)
+++ head/sys/conf/kern.post.mk  Thu Mar 25 13:47:21 2010(r205640)
@@ -15,6 +15,10 @@ MKMODULESENV+=   DESTDIR=${DESTDIR}
 SYSDIR?= ${S:C;^[^/];${.CURDIR}/;}
 MKMODULESENV+= KERNBUILDDIR=${.CURDIR} SYSDIR=${SYSDIR}
 
+.if defined(CONF_CFLAGS)
+MKMODULESENV+= CONF_CFLAGS=${CONF_CFLAGS}
+.endif
+
 .MAIN: all
 
 .for target in all clean cleandepend cleandir clobber depend install \

Modified: head/sys/conf/kmod.mk
==
--- head/sys/conf/kmod.mk   Thu Mar 25 13:15:55 2010(r205639)
+++ head/sys/conf/kmod.mk   Thu Mar 25 13:47:21 2010(r205640)
@@ -325,6 +325,9 @@ ${_src}:
 .endfor
 .endif
 
+# Repsect configuration-specific C flags.
+CFLAGS+=   ${CONF_CFLAGS}
+
 MFILES?= dev/acpica/acpi_if.m dev/acpi_support/acpi_wmi_if.m \
dev/agp/agp_if.m dev/ata/ata_if.m dev/eisa/eisa_if.m \
dev/iicbus/iicbb_if.m dev/iicbus/iicbus_if.m \
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205641 - head/sys/kern

2010-03-25 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Mar 25 14:21:22 2010
New Revision: 205641
URL: http://svn.freebsd.org/changeset/base/205641

Log:
  Change the way text_addr and data_addr are computed to use the
  executable status of segments instead of detecting the main text segment
  by which segment contains the program entry point. This affects
  obreak() and is required for correct operation of that function
  on 64-bit PowerPC systems. The previous behavior was apparently
  required only for the Alpha, which is no longer supported.
  
  Reviewed by:  jhb
  Tested on:amd64, sparc64, powerpc

Modified:
  head/sys/kern/imgact_elf.c

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Thu Mar 25 13:47:21 2010(r205640)
+++ head/sys/kern/imgact_elf.c  Thu Mar 25 14:21:22 2010(r205641)
@@ -832,13 +832,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i
phdr[i].p_vaddr + et_dyn_addr - seg_addr);
 
/*
-* Is this .text or .data?  We can't use
-* VM_PROT_WRITE or VM_PROT_EXEC, it breaks the
-* alpha terribly and possibly does other bad
-* things so we stick to the old way of figuring
-* it out:  If the segment contains the program
-* entry point, it's a text segment, otherwise it
-* is a data segment.
+* Make the largest executable segment the official
+* text segment and all others data.
 *
 * Note that obreak() assumes that data_addr + 
 * data_size == end of data load area, and the ELF
@@ -846,12 +841,10 @@ __CONCAT(exec_, __elfN(imgact))(struct i
 * address.  If multiple data segments exist, the
 * last one will be used.
 */
-   if (hdr-e_entry = phdr[i].p_vaddr 
-   hdr-e_entry  (phdr[i].p_vaddr +
-   phdr[i].p_memsz)) {
+
+   if (phdr[i].p_flags  PF_X  text_size  seg_size) {
text_size = seg_size;
text_addr = seg_addr;
-   entry = (u_long)hdr-e_entry + et_dyn_addr;
} else {
data_size = seg_size;
data_addr = seg_addr;
@@ -871,6 +864,8 @@ __CONCAT(exec_, __elfN(imgact))(struct i
data_size = text_size;
}
 
+   entry = (u_long)hdr-e_entry + et_dyn_addr;
+
/*
 * Check limits.  It should be safe to check the
 * limits after loading the segments since we do
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205642 - in head/sys: amd64/amd64 amd64/ia32 amd64/linux32 arm/arm compat/ia32 i386/i386 i386/linux ia64/ia32 ia64/ia64 kern mips/mips pc98/pc98 powerpc/aim powerpc/booke sparc64/sparc...

2010-03-25 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Mar 25 14:24:00 2010
New Revision: 205642
URL: http://svn.freebsd.org/changeset/base/205642

Log:
  Change the arguments of exec_setregs() so that it receives a pointer
  to the image_params struct instead of several members of that struct
  individually. This makes it easier to expand its arguments in the future
  without touching all platforms.
  
  Reviewed by:  jhb

Modified:
  head/sys/amd64/amd64/machdep.c
  head/sys/amd64/ia32/ia32_signal.c
  head/sys/amd64/linux32/linux32_sysvec.c
  head/sys/arm/arm/machdep.c
  head/sys/compat/ia32/ia32_signal.h
  head/sys/i386/i386/machdep.c
  head/sys/i386/linux/linux_sysvec.c
  head/sys/ia64/ia32/ia32_signal.c
  head/sys/ia64/ia64/machdep.c
  head/sys/kern/kern_exec.c
  head/sys/mips/mips/pm_machdep.c
  head/sys/pc98/pc98/machdep.c
  head/sys/powerpc/aim/machdep.c
  head/sys/powerpc/booke/machdep.c
  head/sys/sparc64/sparc64/machdep.c
  head/sys/sun4v/sun4v/machdep.c
  head/sys/sys/imgact.h
  head/sys/sys/sysent.h

Modified: head/sys/amd64/amd64/machdep.c
==
--- head/sys/amd64/amd64/machdep.c  Thu Mar 25 14:21:22 2010
(r205641)
+++ head/sys/amd64/amd64/machdep.c  Thu Mar 25 14:24:00 2010
(r205642)
@@ -841,11 +841,7 @@ SYSCTL_PROC(_machdep, OID_AUTO, idle, CT
  * Reset registers to default values on exec.
  */
 void
-exec_setregs(td, entry, stack, ps_strings)
-   struct thread *td;
-   u_long entry;
-   u_long stack;
-   u_long ps_strings;
+exec_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
struct trapframe *regs = td-td_frame;
struct pcb *pcb = td-td_pcb;
@@ -863,7 +859,7 @@ exec_setregs(td, entry, stack, ps_string
pcb-pcb_full_iret = 1;
 
bzero((char *)regs, sizeof(struct trapframe));
-   regs-tf_rip = entry;
+   regs-tf_rip = imgp-entry_addr;
regs-tf_rsp = ((stack - 8)  ~0xFul) + 8;
regs-tf_rdi = stack;   /* argv */
regs-tf_rflags = PSL_USER | (regs-tf_rflags  PSL_T);

Modified: head/sys/amd64/ia32/ia32_signal.c
==
--- head/sys/amd64/ia32/ia32_signal.c   Thu Mar 25 14:21:22 2010
(r205641)
+++ head/sys/amd64/ia32/ia32_signal.c   Thu Mar 25 14:24:00 2010
(r205642)
@@ -701,11 +701,7 @@ freebsd32_sigreturn(td, uap)
  * Clear registers on exec
  */
 void
-ia32_setregs(td, entry, stack, ps_strings)
-   struct thread *td;
-   u_long entry;
-   u_long stack;
-   u_long ps_strings;
+ia32_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
struct trapframe *regs = td-td_frame;
struct pcb *pcb = td-td_pcb;
@@ -721,12 +717,12 @@ ia32_setregs(td, entry, stack, ps_string
pcb-pcb_initial_fpucw = __INITIAL_FPUCW_I386__;
 
bzero((char *)regs, sizeof(struct trapframe));
-   regs-tf_rip = entry;
+   regs-tf_rip = imgp-entry_addr;
regs-tf_rsp = stack;
regs-tf_rflags = PSL_USER | (regs-tf_rflags  PSL_T);
regs-tf_ss = _udatasel;
regs-tf_cs = _ucode32sel;
-   regs-tf_rbx = ps_strings;
+   regs-tf_rbx = imgp-ps_strings;
regs-tf_ds = _udatasel;
regs-tf_es = _udatasel;
regs-tf_fs = _ufssel;

Modified: head/sys/amd64/linux32/linux32_sysvec.c
==
--- head/sys/amd64/linux32/linux32_sysvec.c Thu Mar 25 14:21:22 2010
(r205641)
+++ head/sys/amd64/linux32/linux32_sysvec.c Thu Mar 25 14:24:00 2010
(r205642)
@@ -124,8 +124,8 @@ static register_t *linux_copyout_strings
 static voidlinux_prepsyscall(struct trapframe *tf, int *args, u_int *code,
caddr_t *params);
 static void linux_sendsig(sig_t catcher, ksiginfo_t *ksi, sigset_t *mask);
-static voidexec_linux_setregs(struct thread *td, u_long entry,
-  u_long stack, u_long ps_strings);
+static voidexec_linux_setregs(struct thread *td, 
+  struct image_params *imgp, u_long stack);
 static voidlinux32_fixlimit(struct rlimit *rl, int which);
 static boolean_t linux32_trans_osrel(const Elf_Note *note, int32_t *osrel);
 
@@ -828,11 +828,7 @@ exec_linux_imgact_try(struct image_param
  * XXX copied from ia32_signal.c.
  */
 static void
-exec_linux_setregs(td, entry, stack, ps_strings)
-   struct thread *td;
-   u_long entry;
-   u_long stack;
-   u_long ps_strings;
+exec_linux_setregs(struct thread *td, struct image_params *imgp, u_long stack)
 {
struct trapframe *regs = td-td_frame;
struct pcb *pcb = td-td_pcb;
@@ -852,7 +848,7 @@ exec_linux_setregs(td, entry, stack, ps_
pcb-pcb_initial_fpucw = __LINUX_NPXCW__;
 
bzero((char *)regs, sizeof(struct trapframe));
-   regs-tf_rip = entry;
+   regs-tf_rip = imgp-entry_addr;

svn commit: r205643 - in head/sys: kern sys

2010-03-25 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Thu Mar 25 14:31:26 2010
New Revision: 205643
URL: http://svn.freebsd.org/changeset/base/205643

Log:
  Add the ELF relocation base to struct image_params. This will be
  required to correctly relocate the executable entry point's function
  descriptor on powerpc64.

Modified:
  head/sys/kern/imgact_elf.c
  head/sys/kern/kern_exec.c
  head/sys/sys/imgact.h

Modified: head/sys/kern/imgact_elf.c
==
--- head/sys/kern/imgact_elf.c  Thu Mar 25 14:24:00 2010(r205642)
+++ head/sys/kern/imgact_elf.c  Thu Mar 25 14:31:26 2010(r205643)
@@ -943,6 +943,7 @@ __CONCAT(exec_, __elfN(imgact))(struct i
 
imgp-auxargs = elf_auxargs;
imgp-interpreted = 0;
+   imgp-reloc_base = addr;
imgp-proc-p_osrel = osrel;
 
return (error);

Modified: head/sys/kern/kern_exec.c
==
--- head/sys/kern/kern_exec.c   Thu Mar 25 14:24:00 2010(r205642)
+++ head/sys/kern/kern_exec.c   Thu Mar 25 14:31:26 2010(r205643)
@@ -372,6 +372,7 @@ do_execve(td, args, mac_p)
imgp-execlabel = NULL;
imgp-attr = attr;
imgp-entry_addr = 0;
+   imgp-reloc_base = 0;
imgp-vmspace_destroyed = 0;
imgp-interpreted = 0;
imgp-opened = 0;

Modified: head/sys/sys/imgact.h
==
--- head/sys/sys/imgact.h   Thu Mar 25 14:24:00 2010(r205642)
+++ head/sys/sys/imgact.h   Thu Mar 25 14:31:26 2010(r205643)
@@ -56,6 +56,7 @@ struct image_params {
struct vattr *attr; /* attributes of file */
const char *image_header; /* head of file to exec */
unsigned long entry_addr; /* entry address of target executable */
+   unsigned long reloc_base; /* load address of image */
char vmspace_destroyed; /* flag - we've blown away original vm space */
char interpreted;   /* flag - this executable is interpreted */
char opened;/* flag - we have opened executable vnode */
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205647 - head/sys/compat/x86bios

2010-03-25 Thread Jung-uk Kim
Author: jkim
Date: Thu Mar 25 15:56:04 2010
New Revision: 205647
URL: http://svn.freebsd.org/changeset/base/205647

Log:
  Fix stupid typos.  Some VESA BIOSes directly call BIOS interrupt handlers
  within the VBE interrupt handler.  Unfortunately it was causing real mode
  page faults because we were fetching instructions from bogus addresses.
  Pass me the pointyhat, please.
  
  PR:   kern/144654
  MFC after:3 days

Modified:
  head/sys/compat/x86bios/x86bios.c

Modified: head/sys/compat/x86bios/x86bios.c
==
--- head/sys/compat/x86bios/x86bios.c   Thu Mar 25 15:53:02 2010
(r205646)
+++ head/sys/compat/x86bios/x86bios.c   Thu Mar 25 15:56:04 2010
(r205647)
@@ -307,8 +307,8 @@ x86bios_emu_get_intr(struct x86emu *emu,
sp[2] = htole16(emu-x86.R_FLG);
 
iv = x86bios_get_intr(intno);
-   emu-x86.R_IP = iv  0x000f;
-   emu-x86.R_CS = (iv  12)  0x;
+   emu-x86.R_IP = iv  0x;
+   emu-x86.R_CS = (iv  16)  0x;
emu-x86.R_FLG = ~(F_IF | F_TF);
 }
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205649 - head/sys/compat/x86bios

2010-03-25 Thread Jung-uk Kim
Author: jkim
Date: Thu Mar 25 17:03:52 2010
New Revision: 205649
URL: http://svn.freebsd.org/changeset/base/205649

Log:
  Optimize real mode page table lookup.

Modified:
  head/sys/compat/x86bios/x86bios.c

Modified: head/sys/compat/x86bios/x86bios.c
==
--- head/sys/compat/x86bios/x86bios.c   Thu Mar 25 16:31:05 2010
(r205648)
+++ head/sys/compat/x86bios/x86bios.c   Thu Mar 25 17:03:52 2010
(r205649)
@@ -112,17 +112,16 @@ x86bios_set_fault(struct x86emu *emu, ui
 static void *
 x86bios_get_pages(uint32_t offset, size_t size)
 {
-   int i;
+   vm_offset_t page;
 
if (offset + size  X86BIOS_MEM_SIZE + X86BIOS_IVT_SIZE)
return (NULL);
 
if (offset = X86BIOS_MEM_SIZE)
offset -= X86BIOS_MEM_SIZE;
-   i = offset / X86BIOS_PAGE_SIZE;
-   if (x86bios_map[i] != 0)
-   return ((void *)(x86bios_map[i] + offset -
-   i * X86BIOS_PAGE_SIZE));
+   page = x86bios_map[offset / X86BIOS_PAGE_SIZE];
+   if (page != 0)
+   return ((void *)(page + offset % X86BIOS_PAGE_SIZE));
 
return (NULL);
 }
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r205637 - head/sys/netinet6

2010-03-25 Thread Rui Paulo

On 25 Mar 2010, at 10:29, Bjoern A. Zeeb wrote:

 Author: bz
 Date: Thu Mar 25 10:29:00 2010
 New Revision: 205637
 URL: http://svn.freebsd.org/changeset/base/205637
 
 Log:
  We are holding a write lock here so avoid aquiring it twice calling
  the locked version rather than the wrapper function.
 
  MFC after:   6 days
 
 Modified:
  head/sys/netinet6/nd6.c
 
 Modified: head/sys/netinet6/nd6.c
 ==
 --- head/sys/netinet6/nd6.c   Thu Mar 25 10:13:21 2010(r205636)
 +++ head/sys/netinet6/nd6.c   Thu Mar 25 10:29:00 2010(r205637)
 @@ -1168,7 +1168,7 @@ nd6_nud_hint(struct rtentry *rt, struct 


This code is probably missing a:
LLE_WLOCK_ASSERT(lle);
at the beginning.

 
   ln-ln_state = ND6_LLINFO_REACHABLE;
   if (!ND6_LLINFO_PERMANENT(ln)) {
 - nd6_llinfo_settimer(ln,
 + nd6_llinfo_settimer_locked(ln,
   (long)ND_IFINFO(rt-rt_ifp)-reachable * hz);
   }
 done:

--
Rui Paulo

___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205651 - head/sys/dev/bge

2010-03-25 Thread Pyun YongHyeon
Author: yongari
Date: Thu Mar 25 17:17:35 2010
New Revision: 205651
URL: http://svn.freebsd.org/changeset/base/205651

Log:
  Use pci_get_max_read_req() and pci_set_max_read_req() to set maximim
  read request size.

Modified:
  head/sys/dev/bge/if_bge.c

Modified: head/sys/dev/bge/if_bge.c
==
--- head/sys/dev/bge/if_bge.c   Thu Mar 25 17:14:47 2010(r205650)
+++ head/sys/dev/bge/if_bge.c   Thu Mar 25 17:17:35 2010(r205651)
@@ -421,7 +421,6 @@ static uint32_t bge_readreg_ind(struct b
 #endif
 static void bge_writemem_direct(struct bge_softc *, int, int);
 static void bge_writereg_ind(struct bge_softc *, int, int);
-static void bge_set_max_readrq(struct bge_softc *);
 
 static int bge_miibus_readreg(device_t, int, int);
 static int bge_miibus_writereg(device_t, int, int, int);
@@ -561,32 +560,6 @@ bge_writemem_ind(struct bge_softc *sc, i
pci_write_config(dev, BGE_PCI_MEMWIN_BASEADDR, 0, 4);
 }
 
-/*
- * PCI Express only
- */
-static void
-bge_set_max_readrq(struct bge_softc *sc)
-{
-   device_t dev;
-   uint16_t val;
-
-   dev = sc-bge_dev;
-
-   val = pci_read_config(dev, sc-bge_expcap + PCIR_EXPRESS_DEVICE_CTL, 2);
-   if ((val  PCIM_EXP_CTL_MAX_READ_REQUEST) !=
-   BGE_PCIE_DEVCTL_MAX_READRQ_4096) {
-   if (bootverbose)
-   device_printf(dev, adjust device control 0x%04x ,
-   val);
-   val = ~PCIM_EXP_CTL_MAX_READ_REQUEST;
-   val |= BGE_PCIE_DEVCTL_MAX_READRQ_4096;
-   pci_write_config(dev, sc-bge_expcap + PCIR_EXPRESS_DEVICE_CTL,
-   val, 2);
-   if (bootverbose)
-   printf(- 0x%04x\n, val);
-   }
-}
-
 #ifdef notdef
 static uint32_t
 bge_readreg_ind(struct bge_softc *sc, int off)
@@ -2695,7 +2668,8 @@ bge_attach(device_t dev)
 */
sc-bge_flags |= BGE_FLAG_PCIE;
sc-bge_expcap = reg;
-   bge_set_max_readrq(sc);
+   if (pci_get_max_read_req(dev) != 4096)
+   pci_set_max_read_req(dev, 4096);
} else {
/*
 * Check if the device is in PCI-X Mode.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205652 - head/sys/i386/i386

2010-03-25 Thread Alan Cox
Author: alc
Date: Thu Mar 25 17:24:03 2010
New Revision: 205652
URL: http://svn.freebsd.org/changeset/base/205652

Log:
  A ptrace(2) by one processor may trigger a promotion in the address space
  of another process.  Modify pmap_promote_pde() to handle this.  (This is
  not a problem on amd64 due to implementation differences.)
  
  Reported by:  jh@
  MFC after:1 week

Modified:
  head/sys/i386/i386/pmap.c

Modified: head/sys/i386/i386/pmap.c
==
--- head/sys/i386/i386/pmap.c   Thu Mar 25 17:17:35 2010(r205651)
+++ head/sys/i386/i386/pmap.c   Thu Mar 25 17:24:03 2010(r205652)
@@ -3154,7 +3154,7 @@ pmap_promote_pde(pmap_t pmap, pd_entry_t
 * either invalid, unused, or does not map the first 4KB physical page
 * within a 2- or 4MB page.
 */
-   firstpte = vtopte(trunc_4mpage(va));
+   firstpte = pmap_pte_quick(pmap, trunc_4mpage(va));
 setpde:
newpde = *firstpte;
if ((newpde  ((PG_FRAME  PDRMASK) | PG_A | PG_V)) != (PG_A | PG_V)) {
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205653 - head/sys/dev/fb

2010-03-25 Thread Jung-uk Kim
Author: jkim
Date: Thu Mar 25 17:51:05 2010
New Revision: 205653
URL: http://svn.freebsd.org/changeset/base/205653

Log:
  Do not penalize correct or correctable VESA mode tables by calling another
  VBE function.  Most problems should be corrected by the mode table sanity
  check and we only need the paranoid in extremely rare cases.

Modified:
  head/sys/dev/fb/vesa.c

Modified: head/sys/dev/fb/vesa.c
==
--- head/sys/dev/fb/vesa.c  Thu Mar 25 17:24:03 2010(r205652)
+++ head/sys/dev/fb/vesa.c  Thu Mar 25 17:51:05 2010(r205653)
@@ -189,7 +189,9 @@ static int vesa_bios_load_palette2(int s
 #define STATE_ALL  (STATE_HW | STATE_DATA | STATE_DAC | STATE_REG)
 static ssize_t vesa_bios_state_buf_size(void);
 static int vesa_bios_save_restore(int code, void *p, size_t size);
+#ifdef MODE_TABLE_BROKEN
 static int vesa_bios_get_line_length(void);
+#endif
 static int vesa_bios_set_line_length(int pixel, int *bytes, int *lines);
 #if 0
 static int vesa_bios_get_start(int *x, int *y);
@@ -558,6 +560,7 @@ vesa_bios_save_restore(int code, void *p
return (regs.R_AX != 0x004f);
 }
 
+#ifdef MODE_TABLE_BROKEN
 static int
 vesa_bios_get_line_length(void)
 {
@@ -574,6 +577,7 @@ vesa_bios_get_line_length(void)
 
return (regs.R_BX);
 }
+#endif
 
 static int
 vesa_bios_set_line_length(int pixel, int *bytes, int *lines)
@@ -1213,7 +1217,6 @@ static int
 vesa_set_mode(video_adapter_t *adp, int mode)
 {
video_info_t info;
-   int bpsl;
 
if (adp != vesa_adp)
return ((*prevvidsw-set_mode)(adp, mode));
@@ -1295,14 +1298,18 @@ vesa_set_mode(video_adapter_t *adp, int 
if ((info.vi_flags  V_INFO_GRAPHICS) != 0)
vesa_adp-va_line_width /= info.vi_planes;
 
+#ifdef MODE_TABLE_BROKEN
/* If VBE function returns bigger bytes per scan line, use it. */
-   bpsl = vesa_bios_get_line_length();
-   if (bpsl  vesa_adp-va_line_width) {
-   vesa_adp-va_line_width = bpsl;
-   info.vi_buffer_size = bpsl * info.vi_height;
-   if ((info.vi_flags  V_INFO_GRAPHICS) != 0)
-   info.vi_buffer_size *= info.vi_planes;
+   {
+   int bpsl = vesa_bios_get_line_length();
+   if (bpsl  vesa_adp-va_line_width) {
+   vesa_adp-va_line_width = bpsl;
+   info.vi_buffer_size = bpsl * info.vi_height;
+   if ((info.vi_flags  V_INFO_GRAPHICS) != 0)
+   info.vi_buffer_size *= info.vi_planes;
+   }
}
+#endif
 
if (info.vi_flags  V_INFO_LINEAR) {
 #if VESA_DEBUG  1
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


Re: svn commit: r205637 - head/sys/netinet6

2010-03-25 Thread Bjoern A. Zeeb

On Thu, 25 Mar 2010, Rui Paulo wrote:



On 25 Mar 2010, at 10:29, Bjoern A. Zeeb wrote:


Author: bz
Date: Thu Mar 25 10:29:00 2010
New Revision: 205637
URL: http://svn.freebsd.org/changeset/base/205637

Log:
 We are holding a write lock here so avoid aquiring it twice calling
 the locked version rather than the wrapper function.

 MFC after: 6 days

Modified:
 head/sys/netinet6/nd6.c

Modified: head/sys/netinet6/nd6.c
==
--- head/sys/netinet6/nd6.c Thu Mar 25 10:13:21 2010(r205636)
+++ head/sys/netinet6/nd6.c Thu Mar 25 10:29:00 2010(r205637)
@@ -1168,7 +1168,7 @@ nd6_nud_hint(struct rtentry *rt, struct



This code is probably missing a:
   LLE_WLOCK_ASSERT(lle);
at the beginning.


No, the lock is acquired in
ln = nd6_lookup(dst6, ND6_EXCLUSIVE, NULL);
calling into lla_lookup().. ending in in6_lltable_lookup()
and hold if the ln is not NULL.




ln-ln_state = ND6_LLINFO_REACHABLE;
if (!ND6_LLINFO_PERMANENT(ln)) {
-   nd6_llinfo_settimer(ln,
+   nd6_llinfo_settimer_locked(ln,
(long)ND_IFINFO(rt-rt_ifp)-reachable * hz);
}
done:


--
Rui Paulo



--
Bjoern A. Zeeb It will not break if you know what you are doing.
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205656 - head/libexec/ftpd

2010-03-25 Thread Xin LI
Author: delphij
Date: Thu Mar 25 22:41:01 2010
New Revision: 205656
URL: http://svn.freebsd.org/changeset/base/205656

Log:
  Check that gl_pathc is bigger than zero before derefencing gl_pathv.
  When gl_pathc == 0, the content of gl_pathv is undefined.
  
  PR:   bin/144761
  Submitted by: David BERARD contact davidberard fr
  Obtained from:OpenBSD
  MFC after:1 week

Modified:
  head/libexec/ftpd/popen.c

Modified: head/libexec/ftpd/popen.c
==
--- head/libexec/ftpd/popen.c   Thu Mar 25 20:07:30 2010(r205655)
+++ head/libexec/ftpd/popen.c   Thu Mar 25 22:41:01 2010(r205656)
@@ -110,10 +110,11 @@ ftpd_popen(char *program, char *type)
flags |= GLOB_LIMIT;
if (glob(argv[argc], flags, NULL, gl))
gargv[gargc++] = strdup(argv[argc]);
-   else
+   else if (gl.gl_pathc  0) {
for (pop = gl.gl_pathv; *pop  gargc  (MAXGLOBARGS-1);
 pop++)
gargv[gargc++] = strdup(*pop);
+   }
globfree(gl);
}
gargv[gargc] = NULL;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205660 - head/sys/ia64/ia64

2010-03-25 Thread Nathan Whitehorn
Author: nwhitehorn
Date: Fri Mar 26 00:53:13 2010
New Revision: 205660
URL: http://svn.freebsd.org/changeset/base/205660

Log:
  Fix the ia64 build.
  
  Pointy hat to: me

Modified:
  head/sys/ia64/ia64/machdep.c

Modified: head/sys/ia64/ia64/machdep.c
==
--- head/sys/ia64/ia64/machdep.cFri Mar 26 00:49:06 2010
(r205659)
+++ head/sys/ia64/ia64/machdep.cFri Mar 26 00:53:13 2010
(r205660)
@@ -1381,7 +1381,7 @@ exec_setregs(struct thread *td, struct i
 * Assumes that (bspstore  0x1f8)  0x1e0.
 */
suword((caddr_t)tf-tf_special.bspstore - 24, stack);
-   suword((caddr_t)tf-tf_special.bspstore - 16, ps_strings);
+   suword((caddr_t)tf-tf_special.bspstore - 16, imgp-ps_strings);
suword((caddr_t)tf-tf_special.bspstore -  8, 0);
}
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205661 - head/sys/nfsserver

2010-03-25 Thread Rick Macklem
Author: rmacklem
Date: Fri Mar 26 01:19:29 2010
New Revision: 205661
URL: http://svn.freebsd.org/changeset/base/205661

Log:
  Patch the regular NFS server so that it returns ESTALE to the client
  for all errors returned by VFS_FHTOVP(). This is required to ensure
  that EIO doesn't get returned to the client when ZFS is used as the
  server file system.
  
  Tested by:korvus AT comcast.net
  Reviewed by:  jhb
  MFC after:2 weeks

Modified:
  head/sys/nfsserver/nfs_srvsubs.c

Modified: head/sys/nfsserver/nfs_srvsubs.c
==
--- head/sys/nfsserver/nfs_srvsubs.cFri Mar 26 00:53:13 2010
(r205660)
+++ head/sys/nfsserver/nfs_srvsubs.cFri Mar 26 01:19:29 2010
(r205661)
@@ -1128,6 +1128,9 @@ nfsrv_fhtovp(fhandle_t *fhp, int lockfla
}
}
error = VFS_FHTOVP(mp, fhp-fh_fid, vpp);
+   if (error != 0)
+   /* Make sure the server replies ESTALE to the client. */
+   error = ESTALE;
vfs_unbusy(mp);
if (error)
goto out;
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205662 - in head/sys/boot/i386: boot2 gptboot zfsboot

2010-03-25 Thread Xin LI
Author: delphij
Date: Fri Mar 26 01:30:53 2010
New Revision: 205662
URL: http://svn.freebsd.org/changeset/base/205662

Log:
  Our boot loader is capable of booting both i386 and amd64 kernels so
  call it x86 instead of i386.
  
  Suggested by: jhb in response to Alexander Best's loader proposal
  MFC after:1 month

Modified:
  head/sys/boot/i386/boot2/boot2.c
  head/sys/boot/i386/gptboot/gptboot.c
  head/sys/boot/i386/zfsboot/zfsboot.c

Modified: head/sys/boot/i386/boot2/boot2.c
==
--- head/sys/boot/i386/boot2/boot2.cFri Mar 26 01:19:29 2010
(r205661)
+++ head/sys/boot/i386/boot2/boot2.cFri Mar 26 01:30:53 2010
(r205662)
@@ -283,7 +283,7 @@ main(void)
 
 for (;;) {
if (!autoboot || !OPT_CHECK(RBX_QUIET))
-   printf(\nFreeBSD/i386 boot\n
+   printf(\nFreeBSD/x86 boot\n
   Default: %u:%s(%u,%c)%s\n
   boot: ,
   dsk.drive  DRV_MASK, dev_nm[dsk.type], dsk.unit,

Modified: head/sys/boot/i386/gptboot/gptboot.c
==
--- head/sys/boot/i386/gptboot/gptboot.cFri Mar 26 01:19:29 2010
(r205661)
+++ head/sys/boot/i386/gptboot/gptboot.cFri Mar 26 01:30:53 2010
(r205662)
@@ -281,7 +281,7 @@ main(void)
 
 for (;;) {
if (!autoboot || !OPT_CHECK(RBX_QUIET))
-   printf(\nFreeBSD/i386 boot\n
+   printf(\nFreeBSD/x86 boot\n
   Default: %u:%s(%up%u)%s\n
   boot: ,
   dsk.drive  DRV_MASK, dev_nm[dsk.type], dsk.unit,

Modified: head/sys/boot/i386/zfsboot/zfsboot.c
==
--- head/sys/boot/i386/zfsboot/zfsboot.cFri Mar 26 01:19:29 2010
(r205661)
+++ head/sys/boot/i386/zfsboot/zfsboot.cFri Mar 26 01:30:53 2010
(r205662)
@@ -730,7 +730,7 @@ main(void)
 
 for (;;) {
if (!autoboot || !OPT_CHECK(RBX_QUIET))
-   printf(\nFreeBSD/i386 boot\n
+   printf(\nFreeBSD/x86 boot\n
   Default: %s:%s\n
   boot: ,
   spa-spa_name, kname);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205663 - head/sys/fs/nfsserver

2010-03-25 Thread Rick Macklem
Author: rmacklem
Date: Fri Mar 26 01:35:19 2010
New Revision: 205663
URL: http://svn.freebsd.org/changeset/base/205663

Log:
  Patch the experimental NFS server in a manner analagous to r205661
  for the regular NFS server, to ensure that ESTALE is
  returned to the client for all errors returned by VFS_FHTOVP().
  
  MFC after:2 weeks

Modified:
  head/sys/fs/nfsserver/nfs_nfsdport.c

Modified: head/sys/fs/nfsserver/nfs_nfsdport.c
==
--- head/sys/fs/nfsserver/nfs_nfsdport.cFri Mar 26 01:30:53 2010
(r205662)
+++ head/sys/fs/nfsserver/nfs_nfsdport.cFri Mar 26 01:35:19 2010
(r205663)
@@ -2443,6 +2443,9 @@ nfsvno_fhtovp(struct mount *mp, fhandle_
*credp = NULL;
exp-nes_numsecflavor = 0;
error = VFS_FHTOVP(mp, fhp-fh_fid, vpp);
+   if (error != 0)
+   /* Make sure the server replies ESTALE to the client. */
+   error = ESTALE;
if (nam  !error) {
error = VFS_CHECKEXP(mp, nam, exp-nes_exflag, credp,
exp-nes_numsecflavor, secflavors);
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205665 - in head/sys/ia64: ia64 include

2010-03-25 Thread Marcel Moolenaar
Author: marcel
Date: Fri Mar 26 02:29:15 2010
New Revision: 205665
URL: http://svn.freebsd.org/changeset/base/205665

Log:
  Only use the interval timer for clock interrupts on the BSP and
  have the BSP use IPIs to trigger clock interrupts on the APs.
  This allows us to run on hardware configurations for which the
  ITC has non-uniform frequencies across CPUs.
  
  While here, change the clock XIV to type IPI so as to protect
  the interrupt delivery against CPU re-balancing once that's
  implemented.

Modified:
  head/sys/ia64/ia64/clock.c
  head/sys/ia64/ia64/mp_machdep.c
  head/sys/ia64/include/pcpu.h

Modified: head/sys/ia64/ia64/clock.c
==
--- head/sys/ia64/ia64/clock.c  Fri Mar 26 01:57:12 2010(r205664)
+++ head/sys/ia64/ia64/clock.c  Fri Mar 26 02:29:15 2010(r205665)
@@ -43,6 +43,7 @@ __FBSDID($FreeBSD$);
 #include machine/intr.h
 #include machine/intrcnt.h
 #include machine/md_var.h
+#include machine/smp.h
 
 SYSCTL_NODE(_debug, OID_AUTO, clock, CTLFLAG_RW, 0, clock statistics);
 
@@ -91,58 +92,61 @@ ia64_ih_clock(struct thread *td, u_int x
int count;
 
PCPU_INC(md.stats.pcs_nclks);
-   intrcnt[INTRCNT_CLOCK]++;
 
-   itc = ia64_get_itc();
-
-   adj = PCPU_GET(md.clockadj);
-   clk = PCPU_GET(md.clock);
-
-   delta = itc - clk;
-   count = 0;
-   while (delta = ia64_clock_reload) {
-   /* Only the BSP runs the real clock */
-   if (PCPU_GET(cpuid) == 0)
+   if (PCPU_GET(cpuid) == 0) {
+   /*
+* Clock processing on the BSP.
+*/
+   intrcnt[INTRCNT_CLOCK]++;
+
+   itc = ia64_get_itc();
+
+   adj = PCPU_GET(md.clockadj);
+   clk = PCPU_GET(md.clock);
+
+   delta = itc - clk;
+   count = 0;
+   while (delta = ia64_clock_reload) {
+#ifdef SMP
+   ipi_all_but_self(ia64_clock_xiv);
+#endif
hardclock(TRAPF_USERMODE(tf), TRAPF_PC(tf));
-   else
-   hardclock_cpu(TRAPF_USERMODE(tf));
+   if (profprocs != 0)
+   profclock(TRAPF_USERMODE(tf), TRAPF_PC(tf));
+   statclock(TRAPF_USERMODE(tf));
+   delta -= ia64_clock_reload;
+   clk += ia64_clock_reload;
+   if (adj != 0)
+   adjust_ticks++;
+   count++;
+   }
+   ia64_set_itm(ia64_get_itc() + ia64_clock_reload - adj);
+   ia64_srlz_d();
+   if (count  0) {
+   adjust_lost += count - 1;
+   if (delta  (ia64_clock_reload  3)) {
+   if (adj == 0)
+   adjust_edges++;
+   adj = ia64_clock_reload  4;
+   } else
+   adj = 0;
+   } else {
+   adj = 0;
+   adjust_excess++;
+   }
+   PCPU_SET(md.clock, clk);
+   PCPU_SET(md.clockadj, adj);
+   } else {
+   /*
+* Clock processing on the BSP.
+*/
+   hardclock_cpu(TRAPF_USERMODE(tf));
if (profprocs != 0)
profclock(TRAPF_USERMODE(tf), TRAPF_PC(tf));
statclock(TRAPF_USERMODE(tf));
-   delta -= ia64_clock_reload;
-   clk += ia64_clock_reload;
-   if (adj != 0)
-   adjust_ticks++;
-   count++;
}
-   ia64_set_itm(ia64_get_itc() + ia64_clock_reload - adj);
-   ia64_srlz_d();
-   if (count  0) {
-   adjust_lost += count - 1;
-   if (delta  (ia64_clock_reload  3)) {
-   if (adj == 0)
-   adjust_edges++;
-   adj = ia64_clock_reload  4;
-   } else
-   adj = 0;
-   } else {
-   adj = 0;
-   adjust_excess++;
-   }
-   PCPU_SET(md.clock, clk);
-   PCPU_SET(md.clockadj, adj);
-   return (0);
-}
 
-void
-pcpu_initclock(void)
-{
-
-   PCPU_SET(md.clockadj, 0);
-   PCPU_SET(md.clock, ia64_get_itc());
-   ia64_set_itm(PCPU_GET(md.clock) + ia64_clock_reload);
-   ia64_set_itv(ia64_clock_xiv);
-   ia64_srlz_d();
+   return (0);
 }
 
 /*
@@ -154,7 +158,7 @@ cpu_initclocks()
 {
u_long itc_freq;
 
-   ia64_clock_xiv = ia64_xiv_alloc(PI_REALTIME, IA64_XIV_IRQ,
+   ia64_clock_xiv = ia64_xiv_alloc(PI_REALTIME, IA64_XIV_IPI,
ia64_ih_clock);
if (ia64_clock_xiv == 0)
panic(No XIV for clock interrupts);
@@ -169,7 +173,11 @@ cpu_initclocks()

svn commit: r205671 - head/usr.sbin/sysinstall

2010-03-25 Thread Maxim Konovalov
Author: maxim
Date: Fri Mar 26 05:34:13 2010
New Revision: 205671
URL: http://svn.freebsd.org/changeset/base/205671

Log:
  o Trim leading w/space.
  
  PR:   docs/145030
  Submitted by: olgeni
  MFC after:1 week

Modified:
  head/usr.sbin/sysinstall/sysinstall.8

Modified: head/usr.sbin/sysinstall/sysinstall.8
==
--- head/usr.sbin/sysinstall/sysinstall.8   Fri Mar 26 05:20:59 2010
(r205670)
+++ head/usr.sbin/sysinstall/sysinstall.8   Fri Mar 26 05:34:13 2010
(r205671)
@@ -541,7 +541,7 @@ Commit any rc.conf changes to disk.
 Preserve existing rc.conf parameters.
 This is useful if you have a post-install script which modifies rc.conf.
 .El
- .It installExpress
+.It installExpress
 Start an express installation, asking few questions of
 the user.
 .Pp
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org


svn commit: r205672 - head/sbin/setkey

2010-03-25 Thread Maxim Konovalov
Author: maxim
Date: Fri Mar 26 05:35:25 2010
New Revision: 205672
URL: http://svn.freebsd.org/changeset/base/205672

Log:
  o Fix typo.
  
  PR:   docs/145031
  Submitted by: olgeni
  MFC after:1 week

Modified:
  head/sbin/setkey/setkey.8

Modified: head/sbin/setkey/setkey.8
==
--- head/sbin/setkey/setkey.8   Fri Mar 26 05:34:13 2010(r205671)
+++ head/sbin/setkey/setkey.8   Fri Mar 26 05:35:25 2010(r205672)
@@ -674,7 +674,7 @@ add 10.0.11.41 10.0.11.33 esp 0x10001
-A hmac-md5 authentication!! ;
 
 .Ed
-Get the SA information assocaited with first example above:
+Get the SA information associated with first example above:
 .Bd -literal -offset
 get 3ffe:501:4819::1 3ffe:501:481d::1 ah 123456 ;
 
___
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to svn-src-head-unsubscr...@freebsd.org