Commit Graph

410 Commits

Author SHA1 Message Date
ad 68fa584377 Arrange to update cached LWP credentials in userret() rather than during
syscall/trap entry, eliminating a test+branch on every syscall/trap.

This wasn't possible in the 3.99.x timeframe when l->l_cred came about
because there wasn't a reliable/timely way to force an ONPROC LWP running on
a remote CPU into the kernel (which is just about the only new thing in
this scheme).
2023-10-05 19:41:03 +00:00
riastradh 116e826d4c cesfic/intr.h: Expose ipl_cookie_t to userland only with _KMEMUSER.
Probably not necessary but let's be a little more cautious about
this.
2023-07-11 10:55:02 +00:00
riastradh 1a13c0c572 cesfic/intr.h: Expose ipl_cookie_t to userland for crash(8). 2023-07-11 10:47:24 +00:00
abs 17aad41300 Add optoion GENERIC.local include to the end of ~all GENERIC configs
This excludes atari, sgimips, evbmips, evbppc, evbsh3, and hpcarm
all of which have somewhat specific kernel config file layouts
2023-02-12 14:50:37 +00:00
riastradh 6a4b8d6081 swwdog(4): Add to GENERIC kernels.
Plus a handful of others that I'm familiar with.  Lots of special-
purpose kernels should probably have this too but I'm not going
through all the arm, mips, and ppc evaluation board kernels to see
which ones are relevant.

Omitted from systems I know to be very small:
- sun2/GENERIC
- dreamcast/GENERIC
Feel free to remove it from others that need to be kept smaller.

Compile-tested a few of these just in case:
- alpha/GENERIC
- amd64/GENERIC
- evbmips/OCTEON
- i386/GENERIC
- riscv/GENERIC

PR kern/29702
2022-09-29 10:10:05 +00:00
simonb c7ae7f02a8 UFS/LFS dirhash:
- Enable UFS_DIRHASH if the architecture or kernel model specific config
  file can use 128MB of RAM or more.
- Remove experimental tag from UFS_DIRHASH; it's been with RUMP kernel
  and by a number of NetBSD developers for years.
- Add LFS_DIRHASH if LFS was enabled.
- Be somewhat consistent with FS options order.
2022-08-07 02:52:23 +00:00
andvar 71981bce9a s/identifing/identifying/ and s/multipler/multiplier/ in comments. 2022-05-30 09:56:02 +00:00
tsutsui 5cf9c74cef Call cnpollc(9) before cngetc(9) as the cons(9) man page says.
Currently most ports do nothing in cnpollc(9), but this is required to
handle wskbd(9) .set_leds op in cngetc(9) properly, at least on luna68k.
2021-10-09 20:00:41 +00:00
tsutsui e96a59e0fb Call cnpollc(9) before cngetc(9) as the cons(9) man page says.
Affects only inside #ifdef DEBUG part on "trap during panic" in trap.c
derived from hp300.
2021-09-25 19:16:31 +00:00
andvar 207defd036 Add missing double p and d for stopped and overriden accordingly.
Fix few more typos along the way, mainly in copy-pasted comments.
2021-09-11 20:28:03 +00:00
thorpej c7fb772b85 Merge thorpej-cfargs2. 2021-08-07 16:18:40 +00:00
andvar 7991f5a7b8 Fix all remaining typos, mainly in comments but also in few definitions and log messages, reported by me in PR kern/54889.
Also fixed some additional typos in comments, found on review of same files or typos.
2021-07-24 21:31:31 +00:00
thorpej 2685996b0e Merge thorpej-cfargs branch:
Simplify and make extensible the config_search() / config_found() /
config_attach() interfaces: rather than having different variants for
which arguments you want pass along, just have a single call that
takes a variadic list of tag-value arguments.

Adjust all call sites:
- Simplify wherever possible; don't pass along arguments that aren't
  actually needed.
- Don't be explicit about what interface attribute is attaching if
  the device only has one.  (More simplification.)
- Add a config_probe() function to be used in indirect configuiration
  situations, making is visibly easier to see when indirect config is
  in play, and allowing for future change in semantics.  (As of now,
  this is just a wrapper around config_match(), but that is an
  implementation detail.)

Remove unnecessary or redundant interface attributes where they're not
needed.

There are currently 5 "cfargs" defined:
- CFARG_SUBMATCH (submatch function for direct config)
- CFARG_SEARCH (search function for indirect config)
- CFARG_IATTR (interface attribte)
- CFARG_LOCATORS (locators array)
- CFARG_DEVHANDLE (devhandle_t - wraps OFW, ACPI, etc. handles)

...and a sentinel value CFARG_EOL.

Add some extra sanity checking to ensure that interface attributes
aren't ambiguous.

Use CFARG_DEVHANDLE in MI FDT, OFW, and ACPI code, and macppc and shark
ports to associate those device handles with device_t instance.  This
will trickle trough to more places over time (need back-end for pre-OFW
Sun OBP; any others?).
2021-04-24 23:36:23 +00:00
rin 6c56221482 For ports with __HAVE_LEGACY_INTRCNT, turn intrcnt[] and derived
variables into u_int, to match with kern/subr_evcnt.c.
2021-04-02 12:11:41 +00:00
simonb fa2e10609e Define __HAVE_LEGACY_INTRCNT to indicate this port uses legacy intrcnt
interrupt accounting.
2021-04-01 04:42:59 +00:00
thorpej 4de82d111b malloc(9) -> kmem(9) 2020-11-18 03:40:50 +00:00
roy 98f3a8d458 vether: Add to kernel configurations
It's only enabled if the kernel enabled bridge AND tap.
Otherwise it's commented out.
2020-09-27 13:48:49 +00:00
rin 6d74044e30 Add -fno-omit-frame-pointer to m68k kernels with DDB for backtraces.
-omit-frame-pointer is enabled for -O1 and higher for GCC8 by default.
2020-08-10 06:32:57 +00:00
maxv b84521f2f3 Remove references to BRIDGE_IPF, it is now compiled in by default. 2020-08-01 08:20:47 +00:00
ad 4b8a875ae2 uvm_availmem(): give it a boolean argument to specify whether a recent
cached value will do, or if the very latest total must be fetched.  It can
be called thousands of times a second and fetching the totals impacts not
only the calling LWP but other CPUs doing unrelated activity in the VM
system.
2020-06-11 19:20:42 +00:00
jdolecek 68e97caa11 mark nsmb major obsolete 2020-04-04 16:06:10 +00:00
skrll a0a61c51a5 G/C 2020-02-20 08:27:38 +00:00
skrll 94257d06d8 G/C LS{SLEEP,RUN,ONPROC}
LWP status manipulation was moved out of assembly long ago.
2020-02-17 09:09:48 +00:00
tsutsui fc9073f9fe Add MAX/MIN PAGE_SIZE and PAGE_SHIFT definitions of m68k for jemalloc(3).
Background:
- All m68k ports have fixed PAGE_SIZE value in their kernels,
  but each port uses different PAGE_SIZE value (4096 or 8192)
  due to historical reasons.
- Currently module(7) binaries are built per each port so
  all m68k kernel sources don't support run-time variable PAGE_SIZE.
- MI <uvm/uvm_param.h> assumes that the port supports a variable
  PAGE_SIZE on module(7) builds if both MAX_PAGE_SIZE and MIN_PAGE_SIZE
  are defined and they have different values.
- On the other hand, jemalloc(3) checks MAX_PAGE_SHIFT in
  src/external/bsd/jemalloc/include/jemalloc/internal/jemalloc_internal_defs.h
  for internal optimization.
- m68k ports share userland binaries (especially pkgsrc binaries)
  among all ports, so we need to define MAX_PAGE_SHIFT as 13 to
  support m68k ports where PAGE_SIZE==8192.
  (though this would affect only if static binaries built on
   4k page hosts are executed on 8k page hosts)

To solve these inconsistency on PAGE_SIZE definitions,
we should have an independent PAGE_SIZE related definitions
for userland, but it requires major reorganization.
For now (especially for netbsd-9) we define MAX/MIN PAGE_SIZE and
PAGE_SHIFT values in <m68k/vmparam.h> only in !defined(_KERNEL) case.

Discussed on source-changes-d@ and tech-kern@ with christos@ and thorpej@:
 https://mail-index.netbsd.org/source-changes-d/2020/01/thread1.html#012035
 https://mail-index.netbsd.org/tech-kern/2020/01/thread1.html#025954

Should be pulled up to netbsd-9.
2020-02-01 19:41:48 +00:00
ad 5c06357c90 Rename uvm_free() -> uvm_availmem(). 2019-12-31 13:07:09 +00:00
ad ddd3a0be1e uvmexp.free -> uvm_free() 2019-12-21 13:00:20 +00:00
ad 115c1bc097 cpu_need_resched():
- Remove all code that should be MI, leaving the bare minimum under arch/.
- Make the required actions very explicit.
- Pass in LWP pointer for convenience.
- When a trap is required on another CPU, have the IPI set it locally.
- Expunge cpu_did_resched().
2019-11-23 19:40:34 +00:00
ad 8d31b01840 mi_userret(): take care of calling preempt(), set spc_curpriority directly,
and remove MD code that does the same.
2019-11-21 19:23:58 +00:00
chs d47bcd296c in many device attach paths, allocate memory with M_WAITOK instead of M_NOWAIT
and remove code to handle failures that can no longer happen.
2019-11-10 21:16:21 +00:00
chs 3ea1957ac9 do not clear "cold" in MD code, that is done in MI code.
this instance was missed when that was changed 20 years ago.
2019-09-27 00:53:34 +00:00
skrll bf158e33f8 Provide PRIxBUSADDR, PRIxBUSSIZE, PRIuBUSSIZE, and PRIxBSH for all arches
to follow arm and (generic) mips.

Reviewed by christos.
2019-09-23 16:17:54 +00:00
tsutsui c1ee8c0e37 Fix lingering page size comments.
Pointed out by christos@ on port-m68k@:
http://mail-index.netbsd.org/port-m68k/2019/06/06/msg000726.html

XXX: we also need MAX_PAGE_SIZE in somewhere for newer jemalloc?
2019-06-28 15:17:43 +00:00
sevan 75d6e670be Enable BUFQ_PRIOCSCAN, CARP, Veriexec by default in GENERIC kernel configs.
On ports without a GENERIC kernel config enable in individul files, e.g evbmips.
Omit on:
atari, dreamcast, emips, epoc32, evbppc/VIRTEX*, ia64, luna68x, mvme68k,
mvmeppc, playstation2, riscv, sun2, sun3, x68k, zaurus due to resource
constraints or port infancy.
2019-04-26 21:40:28 +00:00
thorpej 91bfaeb675 Overhaul the API used to fetch and store individual memory cells in
userspace.  The old fetch(9) and store(9) APIs (fubyte(), fuword(),
subyte(), suword(), etc.) are retired and replaced with new ufetch(9)
and ustore(9) APIs that can return proper error codes, etc. and are
implemented consistently across all platforms.  The interrupt-safe
variants are no longer supported (and several of the existing attempts
at fuswintr(), etc. were buggy and not actually interrupt-safe).

Also augmement the ucas(9) API, making it consistently available on
all plaforms, supporting uniprocessor and multiprocessor systems, even
those that do not have CAS or LL/SC primitives.

Welcome to NetBSD 8.99.37.
2019-04-06 03:06:23 +00:00
thorpej 9565cd57f0 G/C "MAPPECOPY". It is the deadest of wood, and never actually worked in
NetBSD.
2019-03-14 16:59:09 +00:00
thorpej daca0f564b Refactor the 68040 writeback() from each m68k port's trap handler into a
shared copy: m68040_writeback().  It is essentially a copy of the Atari
version, with some minor cosmetic tweaks and one small performance optimization
from the mvme68k port.

Tested by rjs@ on a Quadra 950.  (Thanks!)
2019-02-18 01:12:22 +00:00
dholland 810a783361 Systematize handling of removed drivers.
- Every driver that was removed and whose number hasn't already been
   reused is now listed with a commented-out "obsolete" line.
 - The format of these has been systematized. Future format changes can
   probably be safely done with a script.
 - This does not include a few cases of assignments that only lasted a
   couple days, or stuff from before major reorgs. Some of these may
   be included nonetheless, because there was a lot of ground to cover
   and therefore not a lot of time to dig into history in detail.

Note that the obsolete listings do not mean the major numbers can
never be reused; that's up to portmasters and/or core. It does mean
that they won't be reused by accident, however, which in some cases
(depending on the driver, how widely used it was, its family of device
nodes, their default permissions, etc.) can be quite dangerous.

Note that some of the things now explicitly listed as obsolete are
really ancient history. My scan went back as far as when the majors
files were added. (But not before that.)
2019-01-28 02:28:56 +00:00
maxv 43c9320743 Remove compat_svr4 and compat_svr4_32, as discussed on tech-kern@ recently,
but also as discussed several times in the past.
2018-12-19 13:57:44 +00:00
rin e9ac1fc994 - Determine KERN_AS automatically depending on whether OPT_MODULAR is
set or not, in the same way as libcompat.

- Specify OPT_MODULAR in the port Makefile instead of KERN_AS.

Now, KERN_AS=library is used for kernels without module(7) for all ports.

OK christos
2018-09-22 12:24:01 +00:00
msaitoh 61e1eb0d0b - Cleanup for dynamic sysctl:
- Remove unused *_NAMES macros for sysctl.
  - Remove unused *_MAXID for sysctls.
- Move CTL_MACHDEP sysctl definitions for m68k into m68k/include/cpu.h and
  use them on all m68k machines.
2018-08-22 01:05:21 +00:00
maxv f71d13bdf7 Unreference IPF/PF from all the config files, and enable NPF instead when
wanted. This also fixes some inconsistencies I saw in several files (eg
IPF options while IPF was not compiled, IPF+PF enabled by default, etc).
2018-08-01 20:04:09 +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
sevan b376ef7f24 Alternate buffer queue strategies no longer considered experimental, update
description.

Discussed on tech-kern
http://mail-index.netbsd.org/tech-kern/2018/01/21/msg023002.html
2018-01-23 14:47:53 +00:00
mrg 95772a8862 clean up COMPAT_* options for native netbsd code:
- new series of files that are useful for saying "i want everything
  since netbsd 1.4", etc.
- use the fact COMPAT_* options have future dependancies to remove
  many redundant options.

removes about 3000 lines total across kernel configuration files.
tested about 30 random kernels in the changed list.
2017-09-14 07:58:38 +00:00
sevan 684872c792 Remove support for VERIFIED_EXEC_FP_RMD160, VERIFIED_EXEC_FP_SHA1, and VERIFIED_EXEC_FP_MD5 options.
These algorithms are either broken or on their way to being broken.

Discussed on tech-security
http://mail-index.netbsd.org/tech-security/2017/08/21/msg000936.html

ok riastradh
2017-09-13 22:24:42 +00:00
maxv f1654d53d9 Remove TCP_COMPAT_42 from the config files. Pass 2. 2017-07-29 12:28:27 +00:00
rin 9e3d987a53 PR port-mac68k/51923
Bump default MAXTSIZ to 32MB for m68k ports, which allos us to use GCC 5.4 on
GENERIC kernels.
Ok jklos
2017-02-02 21:53:54 +00:00
rin 6eadace49f PR port-mac68k/51923
Remove unused SYSPTSIZE and USRPTSIZE from m68k ports.
Ok jklos
2017-02-02 21:50:22 +00:00
christos b4cc495b2a protect against multiple inclusion. 2017-01-14 22:24:43 +00:00
cherry 3a405f030d physmem should be of type psize_t
Also, use PRIxPSIZE when printf(9)ing physmem.
2016-12-22 16:05:14 +00:00