Commit Graph

3002 Commits

Author SHA1 Message Date
christos 39fdb694cb regen 2018-08-21 11:47:37 +00:00
christos 3310f921b5 Unlike gnu sed our sed does not recognize inline labels (separated by
semi-colons) so split the lines, and make sure that command lists end
with a semi-colon.
2018-08-21 11:45:23 +00:00
msaitoh 1b96770f4a rumpdefs.h, rumperr.h and rumperrno2host.h are generated from makerumpdefs.sh.
Don't edit those files directly. Use __inline instead of inline in the
script file. OK'd by christos.
2018-08-21 08:22:33 +00:00
maxv 735ddbc5b3 Retire EtherIP, we have L2TP instead. 2018-08-14 14:49:13 +00:00
pgoyette fb243de875 Regen 2018-08-10 21:47:14 +00:00
pgoyette 3cd7406ad8 Allow syscall_establish() to install new syscalls when the existing
entry-point is either sys_nomodule or sys_nosys.  Update the
makesyscalls.sh script to create a const array of bits to allow
syscall_disestablish() to properly restore the original entry-point.
Update all the initializers of struct emul to initialize the pointer
to the bit array struct emul.

XXX Regen of all files created by makesyscalls.sh will come soon,
XXX followed by a kernel version bump (since struct emul is being
XXX modified).

This commit should address PR kern/45781 and also removes the need
for the work-around for that PR in file

	sys/arch/usermode/modules/syscallemu/syscallemu.c
2018-08-10 21:44:58 +00:00
rjs 8c89512565 regen. 2018-07-31 13:02:15 +00:00
maxv 62c8988166 Remove the kernel PMC code. Sent yesterday on tech-kern@.
This change:

 * Removes "options PERFCTRS", the associated includes, and the associated
   ifdefs. In doing so, it removes several XXXSMPs in the MI code, which is
   good.

 * Removes the PMC code of ARM XSCALE.

 * Removes all the pmc.h files. They were all empty, except for ARM XSCALE.

 * Reorders the x86 PMC code not to rely on the legacy pmc.h file. The
   definitions are put in sysarch.h.

 * Removes the kern/sys_pmc.c file, and along with it, the sys_pmc_control
   and sys_pmc_get_info syscalls. They are marked as OBSOL in kern,
   netbsd32 and rump.

 * Removes the pmc_evid_t and pmc_ctr_t types.

 * Removes all the associated man pages. The sets are marked as obsolete.
2018-07-12 10:46:40 +00:00
ozaki-r 1350b04367 Fix net.inet6.ip6.ifq node doesn't exist
The node (and child nodes) is initialized in sysctl_net_pktq_setup, but the call
of sysctl_net_pktq_setup is skipped unexpectedly.

sysctl_net_pktq_setup is skipped if in6_present is false that indicates the
netinet6 component isn't loaded on rump kernels.  However the flag is
accidentally always false because the flag is turned on in in6_dom_init that is
called after if_sysctl_setup on both normal and rump kernels.

Fix the issue by moving if_sysctl_setup after in6_dom_init (domaininit on normal
kernels).  This fix is ad-hoc but good enough for netbsd-8.  We should refine
the initialization order of network components in the future.

Pointed out by hikaru@
2018-07-03 03:37:03 +00:00
msaitoh 3cd62456f9 Implement the BPF direction filter (BIOC[GS]DIRECTION). It provides backward
compatibility with BIOC[GS]SEESENT ioctl. The userland interface is the same
as FreeBSD.

 This change also fixes a bug that the direction is misunderstand on some
environment by passing the direction to bpf_mtap*() instead of checking
m->m_pkthdr.rcvif.
2018-06-26 06:47:57 +00:00
maya a50c06709e Remove duplicate ; 2018-06-06 01:49:07 +00:00
chs 05ce9ca532 initialize the new gop_putrange method pointer in rumpfs_genfsops too. 2018-06-04 02:29:53 +00:00
chs ba2539a980 merge a new version of the CDDL dtrace and ZFS code.
this changes the upstream vendor from OpenSolaris to FreeBSD,
and this version is based on FreeBSD svn r315983.

in addition to the 10 years of improvements from upstream,
this version also has these NetBSD-specific enhancements:
 - dtrace FBT probes can now be placed in kernel modules.
 - ZFS now supports mmap().
2018-05-28 21:04:59 +00:00
maxv 00ff305a9c Merge ipsec4_input and ipsec6_input into ipsec_ip_input. Make the argument
a bool for clarity. Optimize the function: if M_CANFASTFWD is not there
(because already removed by the firewall) leave now.

Makes it easier to see that M_CANFASTFWD is not removed on IPv6.
2018-05-14 17:34:26 +00:00
maxv f813c44d31 Rename ipsec4_forward -> ipsec_mtu, and switch to void. 2018-05-10 05:08:53 +00:00
christos 020cb6da2f add an empty stub 2018-05-05 23:42:00 +00:00
maxv 19f9cae6f8 Stop using a macro, rename the function to ipsec_init_pcbpolicy directly. 2018-04-28 14:21:03 +00:00
maxv 4070f54bcc M_CLUSTER -> M_EXT_CLUSTER, and remove M_CLUSTER completely. 2018-04-27 08:51:26 +00:00
christos 87fd18f8e5 s/static inline/static __inline/g for consistency. 2018-04-19 21:50:06 +00:00
christos 16b63f9a5b remove now unused crap. 2018-04-12 21:38:59 +00:00
martin 01cb86bb02 Unconditionally include <unistd.h>, as we use ftruncate() unconditionally
too.
Reported (with patch) by Antonio Huete Jimenez in PR 53153, slightly
modified by me.
2018-04-04 09:19:33 +00:00
ryo fe33aa2786 Add initial support for ARMv8 (AARCH64) (by nisimura@ and ryo@)
- sys/arch/evbarm64 is gone and integrated into sys/arch/evbarm. (by skrll@)
- add support fdt. evbarm/conf/GENERIC64 fdt (bcm2837,sunxi,tegra) based generic 64bit kernel config. (by skrll@, jmcneill@)
2018-04-01 04:35:01 +00:00
christos 443a650cb9 Disable NULL pointer check deletion like we do for the kernel in
src/sys/conf/Makefile.kern.inc. This is the same code we are compiling after
all and it has the same issues.
2018-03-03 22:46:30 +00:00
maxv faad9849ec Dedup: merge ipsec4_set_policy and ipsec6_set_policy. The content of the
original ipsec_set_policy function is inlined into the new one.
2018-02-27 15:01:30 +00:00
maxv e9030bedd8 Oops, forgot this file; I just merged two IPsec functions, so adapt
the rump stubs accordingly.
2018-02-27 14:45:43 +00:00
maxv b39a0dd1f8 Dedup: merge ipsec4_in_reject and ipsec6_in_reject into ipsec_in_reject.
While here fix misleading comment.

ok ozaki-r@
2018-02-26 09:04:29 +00:00
maxv c3c5f13028 Dedup: merge ipsec4_hdrsiz and ipsec6_hdrsiz into ipsec_hdrsiz.
ok ozaki-r@
2018-02-26 08:50:25 +00:00
ozaki-r ef58cf2ca2 Avoid a deadlock between softnet_lock and IFNET_LOCK
A deadlock occurs because there is a violation of the rule of lock ordering;
softnet_lock is held with hodling IFNET_LOCK, which violates the rule.
To avoid the deadlock, replace softnet_lock in in_control and in6_control
with KERNEL_LOCK.

We also need to add some KERNEL_LOCKs to protect the network stack surely.
This is required, for example, for PR kern/51356.

Fix PR kern/53043
2018-02-24 07:37:08 +00:00
maxv 63ecc40c9f Move udp6_output() into udp6_usrreq.c, and remove udp6_output.c. This is
more consistent with IPv4, and there is no good reason for keeping a
separate file only for one function. FreeBSD did the same.
2018-02-08 11:34:35 +00:00
ozaki-r 58e4007f7e Obtain proper initialized addresses of locks allocated by mutex_obj_alloc or rw_obj_alloc
Initialized addresses of locks allocated by mutex_obj_alloc or rw_obj_alloc
were not useful because the addresses were mutex_obj_alloc or rw_obj_alloc
itself. What we want to know are callers of them.

(forgot to commit)
2018-02-05 05:00:48 +00:00
mrg f2b04ca083 implement 32-bit compat support for raidframe.
convert several raidframe ioctls to be bitsize idempotent so that
they work the same in 32 and 64 bit worlds, allowing netbsd32 to
configure and query raid properly.  remove useless 'row' in a few
places.  add COMPAT_80 and put the old ioctls there.

raidframeio.h:
  RAIDFRAME_TEST_ACC
  - remove, unused
  RAIDFRAME_GET_COMPONENT_LABEL
  - convert to label not pointer to label
  RAIDFRAME_CHECK_RECON_STATUS_EXT
  RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT
  RAIDFRAME_CHECK_COPYBACK_STATUS_EXT
  - convert to progress info not pointer to info
  RAIDFRAME_GET_INFO
  - version entirely.
raidframevar.h:
  - rf_recon_req{} has row, flags and raidPtr removed (they're
    not a useful part of this interface.)
  - RF_Config_s{} and RF_DeviceConfig_s{} have numRow/rows removed.
  - RF_RaidDisk_s{} is re-ordered slightly to fix alignment
    padding - the actual data was already OK.
  - InstallSpareTable() loses row argument

rf_compat32.c has code for RF_Config_s{} in 32 bit mode, used
by RAIDFRAME_CONFIGURE and RAIDFRAME_GET_INFO32.

rf_compat80.c has code for rf_recon_req{}, RF_RaidDisk_s{} and
RF_DeviceConfig_s{} to handle RAIDFRAME_FAIL_DISK,
RAIDFRAME_GET_COMPONENT_LABEL, RAIDFRAME_CHECK_RECON_STATUS_EXT,
RAIDFRAME_CHECK_PARITYREWRITE_STATUS_EXT,
RAIDFRAME_CHECK_COPYBACK_STATUS_EXT, RAIDFRAME_GET_INFO.

move several of the per-ioctl code blocks into separate functions.

add rf_recon_req_internal{} to replace old usage of global
rf_recon_req{} that had unused void * in the structure, ruining
it's 32/64 bit ABI.

add missing case for RAIDFRAME_GET_INFO50.

adjust raid tests to use the new .conf format, and add a case to
test the old method as well.

raidctl:
deal with lack of 'row' members in a couple of places.
fail request no longer takes row.
handle "START array" sections with just "numCol numSpare", ie
no "numRow" specified.  for now, generate old-style configuration
but update raidctl.8 to specify the new style (keeping reference
to the old style.)

note that: RF_ComponentLabel_s::{row,num_rows} and
RF_SingleComponent_s::row are obsolete but not removed yet.
2018-01-18 00:32:48 +00:00
knakahara 085daa5b79 ipsec(4) interface supports rump now. 2018-01-10 11:02:41 +00:00
ozaki-r 5f7710ea35 Don't start callouts for domains before attaching domains on rump kernels
On rump kernels, the callouts for domains, pffasttimo and pfslowtimo, started
before domains were attached. Normally the callouts were dispatched after
domain attaches (initializations) finished, however, under load the callouts
could be executed prior to the attaches, resulting in that the callouts accessed
unallocated or uninitialized resources.
2018-01-10 02:50:26 +00:00
msaitoh 6619617fbb Set mp_online = ture. I don't know the "best" location to set it true.
This change might fix PR#52886.
2018-01-09 04:55:43 +00:00
kamil f98f70a745 Revert vadvise(2) removal
This system call was used in legacy Lisp code, that was inherited to modern
age and still compiled against supported compat layers (e.g. in clisp,
oaklisp, Franz Lisp).

It used to instruct the kernel about paging policy (G/C aware, flush etc).

Newly compiled code (assuming that it will detect vadvise()) will use the
libc stub for vadvise(). The headers for this interface are gone.

vadvise(2) could be marked as COMPAT_80, but as long as we support ultrix,
sunos or aout68k ABI, don't bother with this.

Requested by <mrg>
2018-01-06 16:41:23 +00:00
ozaki-r 7d3a00795e rump: check if the mutex is surely owned by the caller in mutex_exit
Unlocking a not-owned mutex wasn't detected well (it could detect if the mutex
is not held by anyone but that's not enough). Let's check it (the check is the
same as normal kernel's mutex).

If LOCKDEBUG is enabled, give the check over LOCKDEBUG because it can provide
better debugging information.
2017-12-27 09:03:22 +00:00
ozaki-r 1153933228 Distinguish spin mutex and adaptive mutex on rump kernels for LOCKDEBUG
Formerly rump kernels treated the two types of mutexes as both adaptive for
LOCKDEBUG for some reasons.

Now we can detect violations of mutex restrictions on rump kernels such as
taking an adaptive mutex with holding a spin mutex as well as normal kernels.
2017-12-27 09:01:53 +00:00
ozaki-r 3a665842a3 Tweak LOCKDEBUG macros (NFC) 2017-12-27 08:45:45 +00:00
ozaki-r a45a6f1723 Apply C99-style struct initialization to lockops_t 2017-12-25 09:13:40 +00:00
kamil 102875f88e Drop SYS_vadvise
The (o)vadvise syscall is dummy since the beginning of NetBSD.

It is an obsolete remnant from the old UNIX.

Sponsored by <The NetBSD Foundation>
2017-12-19 19:40:03 +00:00
kamil 885229d011 Drop SYS_sbrk
sbrk - change data segment size

This syscall is dummy since the inception of the project.

Sponsored by <The NetBSD Foundation>
2017-12-19 18:34:47 +00:00
kamil 438b670525 Drop the sstk(2) syscall stub
sstk - change stack section size

This functionality has never been implemented and is a remnant from 16-bit
UNIX. This stub appeared with the first NetBSD commit.

Sponsored by <The NetBSD Foundation>
2017-12-19 08:48:19 +00:00
pgoyette dd351a1d64 Now that the pad module has an ioconf file, we need to provide one for
the rump-component, too.
2017-12-16 09:20:29 +00:00
ozaki-r cb1c111a7d Wrap if_ioctl_lock with IFNET_* macros (NFC)
Also if_ioctl_lock perhaps needs to be renamed to something because it's now
not just for ioctl...
2017-12-11 03:29:20 +00:00
christos 8e2dd5803e regen
XXX: pullup-8
2017-12-08 01:20:52 +00:00
ozaki-r 3c0d913f9e Ensure to call if_addr_init with holding if_ioctl_lock 2017-12-07 03:16:24 +00:00
christos ea05286d92 add fo_name so we can identify the fileops in a simple way. 2017-11-30 20:25:54 +00:00
ozaki-r 9e8ba65a2c Add missing inclusion of pserialize.h (fix build) 2017-11-21 15:22:06 +00:00
ozaki-r 683f5aa5e9 Implement debugging feature for pserialize(9)
The debugging feature detects violations of pserialize constraints.
It causes a panic:
- if a context switch happens in a read section, or
- if a sleepable function is called in a read section.

The feature is enabled only if LOCKDEBUG is on.

Discussed on tech-kern@
2017-11-21 08:49:14 +00:00
martin 0eed1687f3 When truncating a file make sure to update mtime.
This fixes PR kern/51762 for rumpfs.
2017-11-20 17:00:35 +00:00