Commit Graph

7853 Commits

Author SHA1 Message Date
yamt
04c3ad9fba sleepq_insert: call lwp_eprio only when necessary 2011-07-26 13:04:51 +00:00
yamt
b6608b64ad assertion 2011-07-26 13:03:57 +00:00
martin
d43085eb02 Make sure to not overwrite error if it already is EEXISTS - hopefully
will fix > 100 failing fs tests in my last test run.
2011-07-24 09:40:10 +00:00
jym
1e8ddd07b6 When KERN_SA is not defined, kern.no_sa_support is a constant (1). So
add CTLFLAG_IMMEDIATE to flags. Make the macro block logically reversed so
it looks more natural when reading.

Reported by Peter Tworek on tech-kern@.
2011-07-23 11:38:28 +00:00
manu
8bacaec3f4 Add tracepoints for extended attribute names and values, so that
we can figure what is going on when looking at a ktrace output.
2011-07-22 12:46:18 +00:00
christos
442d0c330c don't produce diagnostics for GNU tags 2011-07-19 19:45:36 +00:00
drochner
3c39863810 regen after *setxattr constification 2011-07-18 11:43:53 +00:00
drochner
2ac9241da8 make the data arguments of *setxattr(2) const, as in Linux
(is this an official NetBSD API or should it be COMPAT_LINUX only?)
2011-07-18 11:28:24 +00:00
joerg
3eb244d801 Retire varargs.h support. Move machine/stdarg.h logic into MI
sys/stdarg.h and expect compiler to provide proper builtins, defaulting
to the GCC interface. lint still has a special fallback.
Reduce abuse of _BSD_VA_LIST_ by defining __va_list by default and
derive va_list as required by standards.
2011-07-17 20:54:30 +00:00
christos
dc72548dbe fail with EINVAL if flags not are not O_CLOEXEC|O_NONBLOCK in pipe2(2) and
dup3(2)
2011-07-15 14:50:19 +00:00
hannken
49511bba25 Change VOP_BWRITE() to take a vnode as its first argument like all other
VOPs do.  Layered file systems no longer have to modify bp->b_vp and run
into trouble when an async VOP_BWRITE() uses the wrong vnode.

- change all occurences of VOP_BWRITE(bp) to VOP_BWRITE(bp->b_vp, bp).
- remove layer_bwrite().
- welcome to 5.99.55

Adresses PR kern/38762 panic: vwakeup: neg numoutput

No objections from tech-kern@.
2011-07-11 08:27:37 +00:00
hannken
4094bb1a9f Change VOP_BWRITE() to take a vnode as its first argument like all other
VOPs do.  Layered file systems no longer have to modify bp->b_vp and run
into trouble when an async VOP_BWRITE() uses the wrong vnode.

Adresses PR kern/38762 panic: vwakeup: neg numoutput

No objections from tech-kern@.
2011-07-11 08:23:00 +00:00
mrg
bc7506b1cc avoid some uninitialised variable warnings. 2011-07-08 09:32:45 +00:00
dyoung
22c58b4530 Add default implementations for new bus_space(9) routines. 2011-07-06 18:24:26 +00:00
manu
be95d60797 Add a flag to VOP_LISTEXTATTR(9) so that the vnode interface can tell the
filesystem in which format extended attribute shall be listed.

There are currently two formats:
- NUL-terminated strings, used for listxattr(2), this is the default.
- one byte length-pprefixed, non NUL-terminated strings, used for
  extattr_list_file(2), which is obtanined by setting the
  EXTATTR_LIST_PREFIXLEN flag to VOP_LISTEXTATTR(9)

This approach avoid the need for converting the list back and forth, except
in libperfuse, since FUSE uses NUL-terminated strings, and the kernel may
have requested EXTATTR_LIST_PREFIXLEN.
2011-07-04 08:07:29 +00:00
hannken
3e2f3eaf50 Return EINVAL when trying to create a device node with "rdev == VNOVAL".
Fixes PR #45111 "tmpfs panic with mknod(2)".
2011-07-03 15:25:09 +00:00
mrg
2624874e7c avoid some uninitialised variable warnings from GCC.
at least the puffs one seems valid, but i'm not 100% sure.
2011-07-03 08:57:43 +00:00
bouyer
1f1772a97c Fix kern/45093 as discussed on tech-kern@:
http://mail-index.netbsd.org/tech-kern/2011/06/17/msg010734.html

The cause of the problem is that the so_pendfree is processed with
the softnet_lock held at one point, and processing the list
calls sodoloanfree() which may kpause(). As the thread sleeps with
softnet_lock held, it ultimately cause a deadlock (see the PR or tech-kern
thread for details).
Although it should be possible to call sodopendfree() after releasing
the socket lock, it's not so easy to know where he socket lock is held and
where it's not, so we may hit the issue again later.
Add a kernel thread to handle the so_pendfree list, and wake up this
thread when adding mbufs to this list. Get rid of the various sodopendfree()
calls, hopefully fixing definitively the problem.
2011-07-02 17:53:50 +00:00
dyoung
a256291c3f Don't cast a pointer void * before passing to memset(), that's not
necessary.  Use NULL instead of (type *)0.  This patch produces no
change in the generated assembly.
2011-06-30 22:38:50 +00:00
wiz
4cbd24b23f dependant -> dependent 2011-06-30 20:09:15 +00:00
manu
1bb66616d8 Fix bug introduced in previous commuit: Do not vrele() a vnode we did not
obtained.
2011-06-29 08:01:14 +00:00
matt
2699f92cdb Add the new ci to cpu_infos *before* calling routines which may want to
cpu_lookup.
2011-06-29 06:22:21 +00:00
manu
1a36241e4f Improve a bit listxattr(2). It attemps to list both system and user
extended attributes, and it faled if calling user did not have privilege
for reading system EA. Now we just lise user EA and skip system EA in
reading them is not allowed.
2011-06-28 07:50:03 +00:00
manu
4033ef79a2 Fix multiple non compliances in our Linux-like extattr API, and make it
public so that it can be used.
2011-06-27 16:39:43 +00:00
christos
bc12521d3b regen 2011-06-26 17:05:55 +00:00
christos
7823fd0964 - syscalls that takes socklen_t arguments should do so.
- add pipe2, dup3, paccept, kqueue1
2011-06-26 17:05:24 +00:00
christos
e2bebf7172 * Arrange for interfaces that create new file descriptors to be able to
set close-on-exec on creation (http://udrepper.livejournal.com/20407.html).

    - Add F_DUPFD_CLOEXEC to fcntl(2).
    - Add MSG_CMSG_CLOEXEC to recvmsg(2) for unix file descriptor passing.
    - Add dup3(2) syscall with a flags argument for O_CLOEXEC, O_NONBLOCK.
    - Add pipe2(2) syscall with a flags argument for O_CLOEXEC, O_NONBLOCK.
    - Add flags SOCK_CLOEXEC, SOCK_NONBLOCK to the socket type parameter
      for socket(2) and socketpair(2).
    - Add new paccept(2) syscall that takes an additional sigset_t to alter
      the sigmask temporarily and a flags argument to set SOCK_CLOEXEC,
      SOCK_NONBLOCK.
    - Add new mode character 'e' to fopen(3) and popen(3) to open pipes
      and file descriptors for close on exec.
    - Add new kqueue1(2) syscall with a new flags argument to open the
      kqueue file descriptor with O_CLOEXEC, O_NONBLOCK.

* Fix the system calls that take socklen_t arguments to actually do so.

* Don't include userland header files (signal.h) from system header files
  (rump_syscallargs.h).

* Bump libc version for the new syscalls.
2011-06-26 16:42:39 +00:00
matt
65bd0920b3 Allow PAX_ASLR to be used by itself. 2011-06-23 23:42:43 +00:00
manu
448e1c49b2 Add mount -o extattr option to enable extended attributs (corrently only
for UFS1).
Remove kernel option for EA backing store autocreation and do it by
default. Add a sysctl so that autocreated attriutr size can be modified.
2011-06-17 14:23:50 +00:00
matt
5ca5a72bf6 Deal with PCU state when performing coredumps. As the kernel moves each LWP
into LSSUSPENDED state, have that LWP save its PCU state for the coredump and
release its PCU status since its probably going to be exiting very soon.
Make pcu_save_all tolerate for being called for non-curlwp if that lwp belongs
to the same process, has a state of LSSUSPENDED, and no PCUs are in use.

Make the MD coredump code use pcu_save_all(l) since it'll need to save all
the PCU state anyways and can take advantage of the above tests.
2011-06-13 21:32:42 +00:00
rmind
e225b7bd09 Welcome to 5.99.53! Merge rmind-uvmplock branch:
- Reorganize locking in UVM and provide extra serialisation for pmap(9).
  New lock order: [vmpage-owner-lock] -> pmap-lock.

- Simplify locking in some pmap(9) modules by removing P->V locking.

- Use lock object on vmobjlock (and thus vnode_t::v_interlock) to share
  the locks amongst UVM objects where necessary (tmpfs, layerfs, unionfs).

- Rewrite and optimise x86 TLB shootdown code, make it simpler and cleaner.
  Add TLBSTATS option for x86 to collect statistics about TLB shootdowns.

- Unify /dev/mem et al in MI code and provide required locking (removes
  kernel-lock on some ports).  Also, avoid cache-aliasing issues.

Thanks to Andrew Doran and Joerg Sonnenberger, as their initial patches
formed the core changes of this branch.
2011-06-12 03:35:36 +00:00
uebayasi
064389cedb Fix build; p was not used, but l was passed to kauth. Use curlwp directly. 2011-06-11 03:00:19 +00:00
matt
bdbb859bae Use KASSERTMSG so if these trigger, we can see what exactly caused them to fire. 2011-06-11 01:07:33 +00:00
matt
1f1f4e99e8 l isn't used. nuke it. 2011-06-10 21:02:46 +00:00
uebayasi
282c08f330 do_sys_rename: Kill an unused variable. 2011-06-10 13:07:14 +00:00
matt
a1b165afd2 Make pcu_save_all and pcu_discard_all KASSERTs accept LW_SYSTEM threads
since kthread_create will call lwp_create with lwp0 which may not be curlwp.
2011-06-07 17:51:58 +00:00
matt
f3c47d398e Add some more MI hook points for PCU. Discard the PCU state at lwp_exit and
at exec time.  Before forking, save the PCU state so that cpu_lwp_fork
doesn't have.  Remove MD code which did that before.
2011-06-06 22:04:34 +00:00
njoly
7c78532f22 Create empty temporary rumphdr.types file if missing; to avoid error
messages for compat syscalls files regen.
2011-06-05 14:13:53 +00:00
dsl
ce8178264d Don't directly call sys_sync() from random bits of code, instead
add do_sys_sync() that takes an 'lwp' (for l_cred) as an argument.
Explicitly pass &lwp0 rather than NULL and expecting sys_sync to
  substitute some random lwp.
2011-06-05 09:04:22 +00:00
rmind
3df4c27d37 Revert maxdmap/maxsmap constification, as it causes problems on some
sparc models.  Reported by tsutsui@.
2011-06-03 17:58:18 +00:00
dsl
2ab3977571 Fix type in comment
(before I replace the 'l' with 'curlwp')
2011-06-02 18:54:43 +00:00
alnsn
a739efc5b5 kern/42030 - tracking of file descriptors by ktrace/kdump 2011-06-01 21:24:59 +00:00
christos
1f1986d685 provide a diagnostic for unsplit drivers. 2011-06-01 02:43:33 +00:00
dyoung
0840f9ccfc Don't use the C preprocessor to configure USERCONF. Instead, either do
or do not link in subr_userconf.c and x86_userconf.c.

Provide no-op stubs for userconf_bootinfo(), userconf_init(), and
userconf_prompt().

Delete all occurrences of #include "opt_userconf.h" as well as USERCONF
and __HAVE_USERCONF_BOOTINFO #ifdef'age.
2011-05-31 23:28:52 +00:00
rmind
cfda9e3195 sysctl_proc_corename: perform KAUTH_PROCESS_CORENAME check (for set case)
after the new name is copied into cnbuf.  Spotted by enami@.
2011-05-31 00:15:28 +00:00
christos
41ceba0065 when undoing the sigsuspend setup, either take the signal and allow the
signal path to restore the mask, or restore the mask here.
2011-05-29 22:14:53 +00:00
manu
d1c4787eb6 Add SOCK_SEQPACKET to PL_LOCAL sockets. Based on patch from Jesse Off,
submitted 8 years ago:
http://mail-index.netbsd.org/tech-kern/2003/04/14/0006.html
2011-05-29 03:32:46 +00:00
christos
0b60c7be7c If a signal did not fire, restore the original signal mask for pselect/pollts
using a signal mask. Tested by tron.
2011-05-28 15:33:40 +00:00
uebayasi
c6e687b646 Catch up with B_* flag name changes in debug code. 2011-05-26 04:51:57 +00:00
uebayasi
dcf649145a Support userconf(4) command in boot(8)/boot.cfg(5) on i386/amd64.
From jmmv@, no objections seen in the proposed thread:

	http://mail-index.netbsd.org/tech-kern/2009/01/22/msg004081.html
2011-05-26 04:25:26 +00:00