Commit Graph

8911 Commits

Author SHA1 Message Date
nonaka 61876aebbe fix typo. (s/MODULE_DEFAULT_AUTOLOAD/MODULAR_DEFAULT_AUTOLOAD/) 2014-08-24 11:36:11 +00:00
jnemeth ee79d5b0e4 Create an "options MODULAR_DEFAULT_AUTOLOAD" config option and add
it to all kernel configs that contain "options MODULAR".  This
option turns on module autoloading by default (which is the current
default).  This allows people who don't want module autoloading on
by default to disable it by simply removing/commentting this line.
2014-08-24 07:59:22 +00:00
pooka 71c14bfaa2 Change the meaning of the boolean parameter to domaininit().
was: attach route domain if found from domains link set
now: attach any domain which is found from domains link set

No functional change to monolithic kernel.  In a rump kernel, which
attaches networking domains "modularly", prevents domains from
accidentally leaking in via the link set in static linked scenarios.

Problem reported by cube, Tom Bousso, and the voices in my head.
2014-08-22 11:28:03 +00:00
chs 99a9d84aad eliminate COMPAT_OLDNOTE and just always recognize the old notes. 2014-08-17 23:03:58 +00:00
joerg a26164117a Reorganize symbol table embedding. The existing option SYMTAB_SPACE is
replaced by the make option COPY_SYMTAB set to any value. The copy of
the symbol table is no longer put into a buffer in kern_ksyms.o, but a
small helper object. This object is build first with a dummy size, then
the kernel is linked to compute the real dimension of the symbol table
buffer. After that, the helper object is rebuild and the kernel linked
again.
2014-08-17 21:17:43 +00:00
apb f498235332 Add COMPAT_70 to conf/files; add compat_70 to kern/syscalls.conf
and compat/netbsd32/syscalls.conf.
2014-08-16 17:24:28 +00:00
apb 5f48354283 If mutex_tryenter() fails, don't call mutex_exit(). 2014-08-15 11:05:35 +00:00
mrg e1e8d3be37 avoid calling into time code when cold, and avoid calling nanotime()
if we're not going to use the result anyway.

XXX: not necessarily the best fix, but better than crashing *early*
boot due to too-early nanotime() calls.

XXX: pullup.
2014-08-15 07:39:25 +00:00
riastradh b018e9788e Lock cprng->cs_lock around rndsink_request to avoid race with callback. 2014-08-14 16:28:30 +00:00
riastradh 7e616d7734 Defer cprng_fast_init until CPUs are detected. 2014-08-14 16:27:55 +00:00
riastradh a580220047 done is not guaranteed to be aligned; don't *(uint32_t *) it. 2014-08-11 14:07:55 +00:00
riastradh 2270989b17 buf is not guaranteed to be aligned; don't *(uint32_t *) it. 2014-08-11 13:59:24 +00:00
riastradh bd9701def7 Back out tls-earlyentropy's rnd_add_data.
This caused recursion on rndpool_mtx when called from an rndsource's
callback.

XXX The old and new code here is a minefield demanding another
rototill.

XXX rnd_source_anonymous was not actually used before, and still is
not used now, to be cleaned up later.
2014-08-11 04:26:53 +00:00
jnemeth 3481529578 Add the infrastructure for MODULAR support for Xen kernels. At
the moment, this can only load very simple modules due to missing
symbols.  It is being add at this time to make pullups to the
netbsd-7 branch easier.  It is not enabled by default in any kernels.
2014-08-11 03:43:25 +00:00
joerg 295896705b Needs sys/atomic.h. Only define rnd_skew when it is used. 2014-08-10 18:33:41 +00:00
tls ea6af427bd Merge tls-earlyentropy branch into HEAD. 2014-08-10 16:44:32 +00:00
gson 20b11a7262 Remove the code to allow CTLTYPE_INT and CTLTYPE_QUAD to be read and
written as either 4 or 8 byte values regardless of the type, in
accordance with "Core statement on sysctl 32-bit/64-bit changes",
http://mail-index.netbsd.org/tech-kern/2014/03/26/msg016779.html.
2014-08-09 07:05:42 +00:00
rtr 8cf67cc6d5 split PRU_CONNECT2 & PRU_PURGEIF function out of pr_generic() usrreq
switches and put into separate functions

  - always KASSERT(solocked(so)) even if not implemented
    (for PRU_CONNECT2 only)

  - replace calls to pr_generic() with req = PRU_CONNECT2 with calls to
    pr_connect2()

  - replace calls to pr_generic() with req = PRU_PURGEIF with calls to
    pr_purgeif()

put common code from unp_connect2() (used by unp_connect() into
unp_connect1() and call out to it when needed

patch only briefly reviewed by rmind@
2014-08-09 05:33:00 +00:00
rtr 822872eada split PRU_RCVD function out of pr_generic() usrreq switches and put into
separate functions

  - always KASSERT(solocked(so)) even if not implemented

  - replace calls to pr_generic() with req = PRU_RCVD with calls to
    pr_rcvd()
2014-08-08 03:05:44 +00:00
rtr 1e7c4c7b77 actually use the passed in struct lwp *l instead of curlwp in unp_connect() 2014-08-05 08:52:10 +00:00
rtr 651e5bd3f8 split PRU_SEND function out of pr_generic() usrreq switches and put into
separate functions

   xxx_send(struct socket *, struct mbuf *, struct mbuf *,
       struct mbuf *, struct lwp *)

  - always KASSERT(solocked(so)) even if not implemented

  - replace calls to pr_generic() with req = PRU_SEND with calls to
    pr_send()

rename existing functions that operate on PCB for consistency (and to
free up their names for xxx_send() PRUs

  - l2cap_send() -> l2cap_send_pcb()
  - sco_send() -> sco_send_pcb()
  - rfcomm_send() -> rfcomm_send_pcb()

patch reviewed by rmind
2014-08-05 07:55:31 +00:00
rtr ce6a5ff64f revert the removal of struct lwp * parameter from bind, listen and connect
user requests.

this should resolve the issue relating to nfs client hangs presented
recently by wiz on current-users@
2014-08-05 05:24:26 +00:00
wiz 87561671c1 defintion -> definition 2014-08-03 19:14:24 +00:00
apb 7f8e46d66a BUILDINFO part 2: expose sysctl kern.buildinfo 2014-08-03 09:15:21 +00:00
mrg 332faa4f02 call ->pr_abort(so) now instead of generic PRU_ABORT.
fixes kern/49056, and appears to remove the only missed PRU_ABORT call.
2014-07-31 20:28:59 +00:00
rtr a6b73d7819 * remove declarations of unp_bind, unp_discard, unp_disconnect1, unp_drop,
unp_shutdown1, unp_internalize and unp_output functions from sys/un.h
  and  instead declare them as static in uipc_usrreq.c with prototype
  declarations as necessary.

* remove struct lwp * parameter from unp_output() while here and just
  use curlwp instead.

as discussed with rmind
2014-07-31 14:12:57 +00:00
rtr 892163b8e9 split PRU_DISCONNECT, PRU_SHUTDOWN and PRU_ABORT function out of
pr_generic() usrreq switches and put into separate functions

   xxx_disconnect(struct socket *)
   xxx_shutdown(struct socket *)
   xxx_abort(struct socket *)

   - always KASSERT(solocked(so)) even if not implemented
   - replace calls to pr_generic() with req =
PRU_{DISCONNECT,SHUTDOWN,ABORT}
     with calls to pr_{disconnect,shutdown,abort}() respectively

rename existing internal functions used to implement above functionality
to permit use of the names for xxx_{disconnect,shutdown,abort}().

   - {l2cap,sco,rfcomm}_disconnect() ->
{l2cap,sco,rfcomm}_disconnect_pcb()
   - {unp,rip,tcp}_disconnect() -> {unp,rip,tcp}_disconnect1()
   - unp_shutdown() -> unp_shutdown1()

patch reviewed by rmind
2014-07-31 03:39:35 +00:00
rtr ad6ae402db split PRU_CONNECT function out of pr_generic() usrreq switches and put
into seaparate functions

  xxx_listen(struct socket *, struct mbuf *)

  - always KASSERT(solocked(so)) and KASSERT(nam != NULL)
  - replace calls to pr_generic() with req = PRU_CONNECT with
    pr_connect()
  - rename existin {l2cap,sco,rfcomm}_connect() to
    {l2cap,sco,rfcomm}_connect_pcb() respectively to permit
    naming consistency with other protocols functions.
  - drop struct lwp * parameter from unp_connect() and at_pcbconnect()
    and use curlwp instead where appropriate.

patch reviewed by rmind
2014-07-30 10:04:25 +00:00
ozaki-r eb39a9c3b5 Fix typo in comment 2014-07-30 07:44:00 +00:00
maxv 382770f2eb 'result' -> 'error' 2014-07-25 16:28:12 +00:00
dholland 53d9b9366b typo in comment 2014-07-25 08:30:10 +00:00
dholland 0facca34ba Regen for fdiscard and posix_fallocate. 2014-07-25 08:27:35 +00:00
dholland 738b7a54cf Add fdiscard and posix_fallocate syscalls. 2014-07-25 08:25:47 +00:00
dholland 0233554e35 Regen for VOP_FALLOCATE/VOP_FDISCARD. 2014-07-25 08:18:50 +00:00
dholland 842f3a34a8 Add VOP_FALLOCATE and VOP_FDISCARD. 2014-07-25 08:16:47 +00:00
dholland f9228f4225 Add d_discard to all struct cdevsw instances I could find.
All have been set to "nodiscard"; some should get a real implementation.
2014-07-25 08:10:31 +00:00
dholland 47cbdc3670 Add d_discard to struct bdevsw/cdevsw, and the plumbing to access it.
Unfortunately we need d_discard in both since we need to be able to
discard from both the block and character forms of disks. I'm
increasingly thinking it would be better to restructure the ops
dispatching so each type of device (ttys, disks, tapes, etc.) has its
own function table. Then we wouldn't need to change every tty driver
to add a disk op.
2014-07-25 07:56:14 +00:00
rtr 6dd8eef044 split PRU_BIND and PRU_LISTEN function out of pr_generic() usrreq
switches and put into separate functions
  xxx_bind(struct socket *, struct mbuf *)
  xxx_listen(struct socket *)

  - always KASSERT(solocked(so)) even if not implemented

  - replace calls to pr_generic() with req = PRU_BIND with call to
    pr_bind()

  - replace calls to pr_generic() with req = PRU_LISTEN with call to
    pr_listen()

  - drop struct lwp * parameter from at_pcbsetaddr(), in_pcbbind() and
    unp_bind() and always use curlwp.

rename existing functions that operate on PCB for consistency (and to
free up their names for xxx_{bind,listen}() PRUs

  - l2cap_{bind,listen}() -> l2cap_{bind,listen}_pcb()
  - sco_{bind,listen}() -> sco_{bind,listen}_pcb()
  - rfcomm_{bind,listen}() -> rfcomm_{bind,listen}_pcb()

patch reviewed by rmind

welcome to netbsd 6.99.48
2014-07-24 15:12:03 +00:00
pooka 29937a63ff regen 2014-07-24 12:01:05 +00:00
pooka 675e772e7f Ensure that symbols are aliased to standard names when
using RUMP_KERNEL_IS_LIBC.

For example configure scripts do not always include headers, and if select
is visible as a __RENAME'd __select50 instead of select, configure will
not find it.

before:
=== snip ===
checking for gethostbyname... yes
checking for socket... no
checking for socket in -lsocket... no
=== snip ===

after:
=== snip ===
checking for gethostbyname... yes
checking for socket... yes
checking for main in -linet6... no
=== snip ===

Another option would be to enable the libc compat bits, and it probably
will be done at some point, but this is easier and more self-contained
for now.
2014-07-24 11:58:45 +00:00
rtr 35b22fa96a split PRU_SENDOOB and PRU_RCVOOB function out of pr_generic() usrreq
switches and put into separate functions
  xxx_sendoob(struct socket *, struct mbuf *, struct mbuf *)
  xxx_recvoob(struct socket *, struct mbuf *, int)

  - always KASSERT(solocked(so)) even if request is not implemented

  - replace calls to pr_generic() with req = PRU_{SEND,RCV}OOB with
    calls to pr_{send,recv}oob() respectively.

there is still some tweaking of m_freem(m) and m_freem(control) to come
for consistency.  not performed with this commit for clarity.

reviewed by rmind
2014-07-23 13:17:18 +00:00
pooka ec6e80d6a1 regen 2014-07-23 11:43:29 +00:00
pooka e02952dcd2 In the RUMP_KERNEL_IS_LIBC case, account for WEAKASM, i.e. create a
_sys_foo strong alias, and _foo and foo weak aliases.  This actually
treats all syscalls as WEAKASM, but it's probably(?) harmless, and saves
us from manual work a la libc.  Fixes at least pthread_cancelstub.
2014-07-23 11:41:34 +00:00
maxv 5848af8e14 1) On 64bit systems, don't add the 32bit execsw[] to the global exec array.
exec_elf32 works on 32bit systems only, and will crash 32bit binaries on
   64bit systems.
2) Now that exec_elf32 is dormant, we can give the native ELF loaders the
   highest priority.

Binaries will load faster now (system boot, compilation, etc.).

With the help of njloy@. Discussed a bit on tech-kern@, no disagreement.
2014-07-22 08:18:33 +00:00
maxv 01bd325227 Enable KMEM_REDZONE on DIAGNOSTIC. It will try to catch overflows.
No comment on tech-kern@
2014-07-22 07:38:41 +00:00
maxv 7d6c4f355e Keep setting 'error' as appropriate (even if this place is broken enough
to crash in many other ways...)
2014-07-16 13:26:33 +00:00
maxv 181436319e Tell which dependency has failed 2014-07-14 16:06:48 +00:00
njoly 5ad0cbf81d Allow fill_kproc2() to be used by more than sysctl. 2014-07-12 09:57:25 +00:00
christos e65c85be95 don't cast void * in c. 2014-07-10 21:13:52 +00:00
maxv d319c4685e Simplify a bit 2014-07-10 19:21:46 +00:00