Commit Graph

152579 Commits

Author SHA1 Message Date
riastradh
4c526ee1ed Skip unlinked inodes.
They no longer matter on disk so we don't need to write anything out
for them.
2020-08-13 17:26:43 +00:00
riastradh
56c44c5ee7 Nix trailing whitespace. 2020-08-13 16:45:58 +00:00
msaitoh
dd0fa0d354 Set recovery_mode_timer workqueue's name correctly. 2020-08-13 08:42:18 +00:00
msaitoh
49e1fcd90c Use atomic_cas_uint() and atomic_store_relaxed(). Advised by thorpej@.
Tested by me. OK'd by knakahara.
2020-08-13 08:38:50 +00:00
skrll
0386a306a4 Trailing whitespace 2020-08-13 07:14:04 +00:00
skrll
243e94f8fd Whack-a-mole 2020-08-12 18:30:46 +00:00
skrll
0a3d29f4ed Part IV of ad's performance improvements for aarch64
- Implement pmap_growkernel(), and update kernel pmap's stats with atomics.

- Then, pmap_kenter_pa() and pmap_kremove() no longer need to allocate
  memory nor take pm_lock, because they only modify L3 PTEs.

- Then, pm_lock and pp_lock can be adaptive mutexes at IPL_NONE which are
  cheaper than spin mutexes.

- Take the pmap's lock in pmap_extract() if not the kernel's pmap, otherwise
  pmap_extract() might see inconsistent state.
2020-08-12 13:36:36 +00:00
skrll
739b4cc834 Part III of ad's performance improvements for aarch64
- Assembly language stubs for mutex_enter() and mutex_exit().
2020-08-12 13:28:46 +00:00
skrll
9f2441fc32 Part II of ad's aarch64 performance improvements (cpu_switch.S bugs are
all mine)

- Use tpidr_el1 to hold curlwp and not curcpu, because curlwp is accessed
  much more often by MI code.  It also makes curlwp preemption safe and
  allows aarch64_curlwp() to be a const function (curcpu must be volatile).

- Make ASTs operate per-LWP rather than per-CPU, otherwise sometimes LWPs
  can see spurious ASTs (which doesn't cause a problem, it just means some
  time may be wasted).

- Use plain stores to set/clear ASTs.  Make sure ASTs are always set on the
  same CPU as the target LWP, and delivered via IPI if posted from a remote
  CPU so that they are resolved quickly.

- Add some cache line padding to struct cpu_info, to match x86.

- Add a memory barrier in a couple of places where ci_curlwp is set.  This
  is needed whenever an LWP that is resuming on the CPU could hold an
  adaptive mutex.  The barrier needs to drain the CPU's store buffer, so
  that the update to ci_curlwp becomes globally visible before the LWP can
  resume and call mutex_exit().  By my reading of the ARM docs it looks like
  the instruction I used will do the right thing, but I'm not 100% sure.
2020-08-12 13:19:35 +00:00
jmcneill
54695ccbd8 Add CEC clock 2020-08-12 10:21:00 +00:00
msaitoh
38bc295884 Fix checking return value of atomic_cas_uint().
This change fixes a bug that extra delay() is called only once even if
atomic_cas_uint() isn't failed or delay() isn't called when atomic_cas_uint()
failed.

The reason of this bug was that I simply converted FreeBSD' atomic_cmpset_int()
to atomic_cas_uint(). The return value's semantics is different.
2020-08-12 09:13:46 +00:00
skrll
97e085086c No need for MIPS_EBASE_CPUNUM now that asm.h supports __BITS 2020-08-12 08:57:03 +00:00
skrll
a294f34ae4 Provide assmebler versions of BITS(3) macros. These are only good for
32 bit masks
2020-08-12 08:56:37 +00:00
skrll
9b5aba56ba Don't include mips/asm.h from a C file 2020-08-12 07:37:39 +00:00
skrll
28c2c643ec Improve a comment 2020-08-11 19:46:56 +00:00
maxv
57f445a8f5 Micro-optimize: use pushq instead of pushw. To avoid LCP stalls and
unaligned stack accesses.
2020-08-11 15:48:42 +00:00
maxv
6ba5a95520 Improve the CPUID emulation on nvmm-intel:
- Limit the highest extended leaf.
 - Limit 0x00000007 to ECX=0, for future-proofness.
2020-08-11 15:31:51 +00:00
maxv
cdb3ed2a3d Improve emulation of MSR_IA32_ARCH_CAPABILITIES: publish only the *_NO
bits. Initially they were the only ones there, but Intel then added other
bits we aren't interested in, and they must be filtered out.
2020-08-11 15:27:46 +00:00
maxv
f4588bfb74 Hide OSPKE. NFC since the host never uses PKU, but still. 2020-08-11 15:23:10 +00:00
uwe
7dbbb5b019 DEV_VERBOSE_DEFINE - use MODULE_CLASS_DRIVER to match the definition.
Catch up with previous to unbreak autoloading of verbose modules.
PR kern/55535

CVS: ----------------------------------------------------------------------
CVS: CVSROOT  cvs.NetBSD.org:/cvsroot
CVS: please use "PR category/123" to have the commitmsg appended to PR 123
CVS:
CVS: Please evaluate your changes and consider the following.
CVS: Abort checkin if you answer no.
CVS: => For all changes:
CVS: Do the changed files compile?
CVS: Has the change been tested?
CVS: => If you are not completely familiar with the changed components:
CVS: Has the change been posted for review?
CVS: Have you allowed enough time for feedback?
CVS: => If the change is major:
CVS: => If the change adds files to, or removes files from $DESTDIR:
CVS: => If you are changing a library or kernel interface:
CVS: Have you successfully run "./build.sh release"?
2020-08-11 12:10:10 +00:00
skrll
46de5abef9 s/pmaphist/maphist/ 2020-08-11 07:03:33 +00:00
skrll
221a897233 s/pmaphist/maphist/ for now 2020-08-11 06:54:14 +00:00
skrll
a9bc40de8f More UVMHIST_LOG. Remove some commented output printfs. 2020-08-11 06:09:44 +00:00
skrll
37a00c7c5d Fix a comment 2020-08-11 05:43:45 +00:00
christos
14e6a323b7 - fix lcall test
- refactor all the TRAP_SIGDEBUG printfs and use hexdump like we did on
  amd64
2020-08-11 04:30:16 +00:00
rjs
31047c8f55 NetBSD 9.99.70 - changes to video(4). 2020-08-10 19:29:13 +00:00
rjs
5d3121f64a Add some extra V4L ioctl() requests to latest V4L userland to work.
Import sys/videoio.h from OpenBSD, this is just the Linux headers
concatenated together.
2020-08-10 19:27:27 +00:00
skrll
76b3785162 More SYNC centralisation 2020-08-10 14:37:38 +00:00
rin
3123ec52cf Output offsets in hex for UVMHIST. 2020-08-10 11:09:15 +00:00
rin
1b18db475e Clean up _LKM --> _MODULE leftovers.
Note that _KERNEL is always defined for modules.
2020-08-10 10:59:33 +00:00
rin
0e29220ba7 Fix siginfo support for amiga, mac68k, and sun3:
- T_ZERODIV is integer divide by zero. Therefore, ksi_code should be
  FPE_INTDIV, not FPE_FLTDIV.

- Set ksi_addr for SIGTRAP. Also, set TRAP_BRKPT or TRAP_TRACE to
  ksi_code appropriately.

This fixes some tests in lib/libc/sys and lib/libc/gen.

XXX
Apply similar fixes to other m68k ports.
2020-08-10 10:51:21 +00:00
rin
d8e87ad9ad Forbid to set odd address to PC in process_write_regs() and process_set_pc().
Otherwise, address error occurs in kernel at rte instruction when returning
to the user level.

Found by tests/lib/libc/t_ptrace_*:access_regs_set_unaligned_pc_0x[137].
2020-08-10 09:38:48 +00:00
rin
2c862b66b0 Make x68k/stand compile with GCC8. Tested with XEiJ. 2020-08-10 07:00:49 +00:00
skrll
cf9ae24dea Whitespace 2020-08-10 06:53:11 +00:00
rin
76c3a0bc77 regen 2020-08-10 06:33:45 +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
rin
2d72fb0c8c Reduce kernel size by
- Adding -fno-asynchronous-unwind-tables and -fno-unwind-tables to COPTS
- Specify NO_KERNEL_RCSIDS to strip RCSIDS
Also adding -fno-omit-frame-pointer to COPTS for backtrace in DDB.
2020-08-10 06:29:49 +00:00
rin
293b2f4b88 Compile sun2 kernel with -fno-omit-frame-pointer for GCC8 as a work
around for reproducible kernel freezes just after ``Starting postfix.'',
where I cannot even enter DDB nor obtain crash dump.

I still haven't figured out why. Possibly something wrong with -Os
optimization level for GCC/m68k, cf.,
http://mail-index.netbsd.org/port-sun3/2020/07/19/msg000166.html
2020-08-10 06:28:42 +00:00
rin
0d644b585e Add hack to compile aes_ccm_tag() with -O0 for m68k for GCC8.
GCC 8 miscompiles aes_ccm_tag() for m68k with optimization level -O[12],
which results in failure in aes_ccm_selftest():

| aes_ccm_selftest: tag 0: 8 bytes @ 0x4d3e38
| 03 80 5f 08 22 6f cb fe                          | .._."o..
| aes_ccm_selftest: verify 0 failed
| ...
| WARNING: module error: built-in module aes_ccm failed its MODULE_CMD_INIT, error 5

This is observed for amiga (A1200, 68060), mac68k (Quadra 840AV, 68040),
and luna68k (nono, 68030 emulator). However, it is not for sun3 (TME, 68020
emulator) and sun2 (TME, 68010 emulator). At the moment, it is unclear
whether this is due to differences b/w 68010-20 vs 68030-60, or something
wrong with TME.
2020-08-10 06:27:29 +00:00
skrll
099ab6bd4c More UVMHIST_LOG and a new KASSERT 2020-08-10 05:40:21 +00:00
skrll
e4e716b95a In pmag_page_remove initilise pvp after taking the page lock 2020-08-10 05:38:43 +00:00
christos
588fbd37da move lcall sniffer to x86_machdep since xen/pv has its own cpu.c 2020-08-09 15:32:44 +00:00
skrll
f38574be5f ONe '#' is enough for a comment 2020-08-09 09:23:17 +00:00
skrll
6b437b00d5 Fix another UVMHIST so it doesn't use %s 2020-08-09 09:11:41 +00:00
skrll
32d85e66e4 More whitespace 2020-08-09 08:49:00 +00:00
skrll
7677265e90 defflag foo on each line to make searching easier.
sort some lines and fix some indentation while I'm here.
2020-08-09 08:48:25 +00:00
skrll
ae934c0d96 This file is only ever used when MULTIPROCESSOR so unifdef MULTIPROCESSOR 2020-08-09 08:33:52 +00:00
skrll
e827fdfc5f Use compiler defines to determine which LLSCSYNC, et al
to provide.

This should fix mips builds.
2020-08-09 08:13:09 +00:00
skrll
f338a15af7 Don't use %s in UVMHIST_PRINT. Remove an unnecessary #ifdef UVMHIST while
I'm here
2020-08-09 07:26:20 +00:00
skrll
f10dba68fc Add a comment 2020-08-09 07:09:35 +00:00