Commit Graph

279581 Commits

Author SHA1 Message Date
thorpej
13ce49a3d0 - Undo part of rev 1.264; go back to not acquiring the pmap lock in
pmap_activate().  As of rev 1.211, the pmap::pm_lev1map field is
  stable across the life of the pmap, and so the conditino that
  the change in 1.264 was intended to avoid would not have happened
  anyway.
- Explicitly use __cacheline_aligned / COHERENCY_UNIT rather than 64
  in a couple of places.
- Update comments around the lev1map lifecycle, and add some assertions
  to enforce the assumptions being described.
- Remove some dubious DEBUG tests that are not MP-safe.
- Chage some long-form #ifdef DIAGNOSTIC checks / panics to KASSERTs.
- Remove the PMAP_ACTIVATE() macro because it's no longer used anywhere
  except for pmap_activate().  Just open-code the equivalent there.
- In pmap_activate(), only perform the SWPCTX if either the PTBR or the
  ASN are different than what the PCB already has.  Also assert that
  preemption is disabled and that the specified lwp is curlwp.
- In pmap_deactivate(), add similar assertions, and add a comment explaining
  why a SWPCTX to get off of the deactivated lev1map is not necessaray.
- Refactor some duplicated code in pmap_growkernel() into a new
  pmap_kptpage_alloc() function.
- In pmap_growkernel(), assert that any user pmap published on the all-pmaps
  list does not reference the kernel_lev1map.
- In pmap_asn_alloc(), get out early if we're called with the kernel pmap,
  since all kernel mappings are ASM.  Remove bogus assertions around the
  value of pmap::pm_lev1map and the current ASN, and simply assert that
  pmap::pm_lev1map is never kernel_lev1map.  Also assert that preemption
  is disabled, since we're manipulating per-cpu data structures.
- Convert the "too much uptime" panic to a simple KASSERT, and update the
  comment to reflect that we're only subject to the longer 75 billion year
  ASN generation overflow (because CPUs that don't implement ASNs never go
  through this code path).
2020-08-16 20:04:36 +00:00
rillig
54a8ac11f2 make(1): move tests for the :M modifier into separate files
The test for the different escaping has been adjusted to actually show
the different parsing results in the test output.  To do this, it had to
get its own file since it needs the -dv debug flag and specialized
post-processing.
2020-08-16 20:03:52 +00:00
rillig
2a9b06ae0f make(1): run tests in an almost empty, controlled environment
Several of the tests use simple variable names that might be influenced
by environment variables of the same name.  Especially the tests for the
?= variable assignment operator need an empty environment to start with,
to produce reliable results.

The PATH must be in the base environment since several tests depend on
the usual tools like echo(1), sleep(1), grep(1).  Setting the PATH to a
fixed value would have made it impossible to run the tests in a custom
environment that don't have a /bin directory.  It's the user's
responsibility to provide a sane PATH.
2020-08-16 18:40:13 +00:00
rillig
065a407e05 make(1): force all tests to be run with the -r flag
Without that flag, <sys.mk> is loaded before the tests.  The tests are
not intended to either use or even test these rules and definitions,
therefore it is safe to omit this command line option.

If there should ever be tests for POSIX-conformance that need the
builtin rules and definitions, these tests can still ".include <sys.mk>"
at the beginning and be done with it, since the -m command line option
is not touched.  The system-default rules and definitions are still
available, they are just not active by default.

Suggested by sjg.
2020-08-16 18:17:17 +00:00
thorpej
1c09ed02a1 In cpu_lwp_fork(), make sure that the PTBR field in l2's HWPCB references
the lev1map associated with l2's pmap.  Otherwise, the first time we
SWPCTX to l2, we'll be on l1's page tables until the first pmap_activate()
call for l2.
2020-08-16 18:05:52 +00:00
rillig
2e45c79a8e make(1): use consistent formatting for running the tests
With the many newly added tests, having two messages ("testing xzy" and
"postprocessing xyz") made the output too noisy since the words were not
aligned nicely.  Use the same formatting as for MAKEVERBOSE=0, and
remove the message for postprocessing.  If there should ever be problems
during postprocessing, it's trivial to run "../make TESTS=bad-test -dl"
to find out where the problem is.
2020-08-16 18:04:33 +00:00
riastradh
613921b5b8 Fix AES NEON code for big-endian softfp ARM.
...which is how the kernel runs.  Switch to using __SOFTFP__ for
consistency with how it gets exposed to C, although I'm not sure how
to get it defined automagically in the toolchain for .S files so
that's set manually in files.aesneon for now.
2020-08-16 18:02:03 +00:00
rillig
5468fbd3be make(1): clean up cleaning of test files
The variables CLEANFILES and CLEANDIRS are not supposed to be
user-settable, thus use a simple "=" instead of "+=".

Since CLEANDIRS is always set, there is no point in making the rm
conditional.
2020-08-16 17:58:48 +00:00
thorpej
2ba5a80446 Be explcit that all calls to pmap_activate() and pmap_deactivate()
from MI code are made with preemption disabled and with l == curlwp.
2020-08-16 16:48:08 +00:00
skrll
f26cdb5c71 G/C MP_CPU_INFO_MEMBERS 2020-08-16 16:01:35 +00:00
martin
9c197a80ad Restrict the NEON code to v7hf - the softfloat toolchain does not like
it (nor is it likely to work if there is no FPU present).
2020-08-16 15:52:14 +00:00
rillig
0920a26f30 make(1): fix archive test
At the beginning of that test, the library archive obviously does not
exist yet.

This test failure is a bit hard to detect since the test is disabled in
usr.bin/make, but not in tests/usr.bin/make.  This is because the latter
just runs all .mk files as tests, no matter whether they are commented
out or not.
2020-08-16 14:39:50 +00:00
rillig
adba330b30 make(1): describe the purpose of each newly added unit test dummy 2020-08-16 14:25:16 +00:00
rillig
70dfb9c270 make(1): move tests for the :gmtime and ::= modifiers to separate files 2020-08-16 12:48:55 +00:00
rillig
6149716f0b make(1): move tests for :S, :C, :@ from modmisc to their separate tests 2020-08-16 12:30:45 +00:00
rillig
d126d9d551 make(1): add dummies for fine-grained tests, one per single feature
The test names have been derived from the current manual page.

All these tests are dummies right now, and the code from the existing
tests will be moved into the new tests step by step.

This is done to prevent modmisc, escape, varmod-edge and varmisc from
growing without any bounds, and to reduce the side-effects of one test
to the others.
2020-08-16 12:07:50 +00:00
mrg
5f6277270e bump image from 3000k to 3.5M. thanks, time. 2020-08-16 11:43:36 +00:00
jdolecek
2d68cdd6ba note COMPAT_LINUX is disabled by default now 2020-08-16 10:31:40 +00:00
jdolecek
dd45d45423 make COMPAT_LINUX option disabled by default
leave the option enabled only in amd64/i386 ALL kernels to make
sure it continues to be compilable also when included in kernel
2020-08-16 10:27:47 +00:00
skrll
1344fd3121 Improve comments 2020-08-16 10:08:42 +00:00
skrll
3c6d0a11a5 Welcome to 9.99.71 - changes to arm/aarch64 struct cpu_info
Thanks to mrg@ for the hint
2020-08-16 09:41:50 +00:00
skrll
a334a57f55 Define COHERENCY_UNIT and CACHE_LINE_SIZE to fix arm builds.
The recent change to cpu.h and struct cpu_info needs an early definition
for the ARM_INTR_IMPLs that want to inline the spl functions and get
{,set_}curcpl() from cpu.h
2020-08-16 09:37:30 +00:00
isaki
bc6beee95c Update and fix.
All primary bootloaders can recognize Human68k partition table.
2020-08-16 07:25:51 +00:00
isaki
76c2ed7cdd Replace boot_ustar with xxboot_ustarfs.
The old boot_ustar had many hard coding and was small(<1KB).
The new xxboot_ustarfs is a part of integrated larger(<8KB) xxboot.
We had to maintain three similar but not the same bootloaders, but
now we have two!
2020-08-16 07:03:45 +00:00
isaki
7e73c3a86c Overhaul xxboot. And merge floppy boot, taken from boot_ustar.
- Rewrite boot.S completely.
  boot.S now supports boot from SCSI HD/CD and floppy.
- Use IOCS call to identify the floppy format, instead of chkfmt.s which
  accesses hardware directly.
- Import print_hex() debug function from boot_ufs.
- Import a feature that displays initial registers (for debug) from boot_ufs,
  and restore it (this in boot_ufs has been broken).
- Add size optimized alternatives for some libkern routines.
- Stop linking libsa to prevent to link unexpected objects.
- Bump version to 2.0.
2020-08-16 06:43:43 +00:00
mrg
16596b51e5 switch netbsd/m68k to GCC 8.
special thanks to rin@ for fixing many things and figuring out
what was the major issue (STACK_BOUNDARY.)
2020-08-16 06:43:05 +00:00
riastradh
ae3eedf331 Fix sloppy mistakes in previous.
1. Give the offset of the rbnode, not some other random members to
   overwrite with garbage.

2. Don't try to unlock a mutex at NULL.

3. Make sure all paths out after ugenif_acquire go via
   ugenif_release.
2020-08-16 06:17:31 +00:00
riastradh
c107c49a73 Initialize the i2c controller before using it.
Fixes mutex uninitialized panic in LOCKDEBUG.
2020-08-16 03:48:59 +00:00
riastradh
d21e522e87 Expose Yubikey CCID interface to userland via ugenif. 2020-08-16 02:38:06 +00:00
riastradh
ee406c527b Share unit numbering for ugen and ugenif.
This way putting ugenif in kernel config actually works to wire it to
the /dev/ugenN.MM device nodes in userland.

Not a fully fleshed out solution to the ugen problem -- there's no
way for a userland driver to kick out a kernel driver and take over,
but this will let us, e.g., use uhidev(4) for Yubikey OTP/U2F/FIDO2
but ugen(4), with pcscd(8), for Yubikey CCID.

Fix various MP-safety issues while here (still not MPSAFE, but more
progress).
2020-08-16 02:37:19 +00:00
riastradh
6269170c9d Convert DIAGNOSTIC prints to KASSERTs. 2020-08-16 02:34:54 +00:00
riastradh
b663bb53fc Hold the lock over access to the data structures it covers.
Still not MPSAFE, but progress.
2020-08-16 02:34:20 +00:00
riastradh
a2da0435ef Remove UGEN_ASLP microoptimization.
cv_signal already has this microoptimization.

While here, make the lock cover the relevant things we're issuing
cv_signal about -- progress toward real MP-safety.
2020-08-16 02:33:17 +00:00
chs
0d0b0c4dc4 in uvm_findpage(), when uvm_page_array_fill_and_peek() returns a page
that is not the one we want and we make an assertion about dirtiness,
check the dirty status of the page we wanted rather than the page we got.
2020-08-16 00:24:41 +00:00
thorpej
f61f342c10 Convert some #ifdef DIAGNOSTIC checks to KASSERTs. NFCI. 2020-08-15 16:09:07 +00:00
nia
9fa431f295 Use sysctl -n hw.machine_arch so this works on e.g. aarch64
Ues HTTPS
2020-08-15 14:47:28 +00:00
nia
a39c900319 afterboot.8: Correct URL directory order 2020-08-15 14:45:31 +00:00
nia
aec9844dc5 afterboot.8: Use cdn. Don't be arch specific. Requested by leot. 2020-08-15 14:42:02 +00:00
nia
5d8c072424 afterboot.8: Mention mdnsd 2020-08-15 13:49:09 +00:00
nia
75bbbb9826 afterboot.8: Explain devpubd 2020-08-15 13:44:14 +00:00
nia
e33fbdfad9 afterboot.8: Be clearer about exactly when you might need to login as root 2020-08-15 13:35:12 +00:00
skrll
317fb4dd44 #ifdef _ARM_ARCH_7 the dmbs 2020-08-15 13:33:54 +00:00
nia
857376a344 afterboot.8: Explain how to install pkgin on a fresh system 2020-08-15 13:32:26 +00:00
nia
21521a3c01 afterboot.8: Explain how connecting to open WiFi works with wpa_supplicant 2020-08-15 13:25:14 +00:00
mlelstv
8f599c8a78 Plaintext buffers are used directly for write() operations to the raw device.
Align them to the needs of cgd(4).
2020-08-15 10:03:10 +00:00
mrg
fc8474c3ed move stacktrace_subr() from trap.c into new mips_stacktrace.c so
it can be shared between ddb, other mips kernel components (see
locore), and an upcoming crash(8) port.

remove second copy of kdbpeek() (hidden by old DDB_TRACE
option, but they're functionally equivalent.)

tested on octeon.

ok simonb@
2020-08-15 07:42:07 +00:00
chs
b0597d5997 use uint64_t rather than int for storing the index of a page within an object. 2020-08-15 07:24:09 +00:00
mrg
073d3fd154 there was no MIPS{32,64} release 4.
XXX: missing lots and lots of evbmips CPUs.
2020-08-15 05:41:57 +00:00
simonb
389e112e68 Remove a misleading space in a ".elif". 2020-08-15 05:03:06 +00:00
simonb
9f936cf095 Fix value for SCE/SWE instructions.
Problem noticed by mrg@.
2020-08-15 04:27:28 +00:00