Commit Graph

152318 Commits

Author SHA1 Message Date
riastradh fe314d33a5 Remove now-needless AES-CCM fallback logic.
These paths are no longer exercised because all of the aes_impls now
do the AES-CCM operations.
2020-07-25 22:36:42 +00:00
riastradh f8ae41373c Implement AES-CCM with NEON. 2020-07-25 22:36:06 +00:00
riastradh 36d44afd5a Implement AES-CCM with ARMv8.5-AES. 2020-07-25 22:33:04 +00:00
riastradh 9fab18571b Invert some loops to save a branch instruction on every iteration. 2020-07-25 22:32:09 +00:00
riastradh 71992d371e Implement AES-CCM with VIA ACE. 2020-07-25 22:31:32 +00:00
riastradh 2619efef58 Implement AES-CCM with SSSE3. 2020-07-25 22:31:04 +00:00
riastradh 081e09b4c1 Implement AES-CCM with SSE2. 2020-07-25 22:29:56 +00:00
riastradh 6054d74828 Implement AES-CCM with x86 AES-NI. 2020-07-25 22:29:06 +00:00
riastradh e5b7ee8558 Implement AES-CCM with BearSSL's bitsliced 32-bit aes_ct. 2020-07-25 22:28:27 +00:00
riastradh ebf44a5b26 Push CBC-MAC and CCM block updates into the aes_impl API.
This should help reduce the setup and teardown overhead (enabling and
disabling fpu, or expanding bitsliced keys) for CCM, as used in
802.11 WPA2 CCMP.  But all the fiddly formatting details remain in
aes_ccm.c to reduce the effort of implementing it -- at the cost of a
handful additional setups and teardowns per message.

Not yet implemented by any of the aes_impls, so leave a fallback that
just calls aes_enc for now.  This should be removed when all of the
aes_impls provide CBC-MAC and CCM block updates.
2020-07-25 22:27:53 +00:00
riastradh c79a1e3b24 Convert malloc -> kmem.
Switch order of members for better alignment.  Sort includes.
2020-07-25 22:27:05 +00:00
uwe a9db036993 Definitions for ST40 Privileged Mapping Buffer. 2020-07-25 22:26:59 +00:00
riastradh 789f2860cf Convert ieee80211_crypto_ccmp.c to new aes_ccm API.
This will make it easier to provide better hardware acceleration
without fpu enabling/disabling overhead for each block of data.
2020-07-25 22:26:23 +00:00
riastradh a01e9ee803 New aes_ccm API.
Intended for use in net80211 for WPA2 CCMP.
2020-07-25 22:15:55 +00:00
riastradh 820a30e585 Split aes_cbc_* and aes_xts_* into their own header files.
aes.h will remain just for key setup; any particular construction using
AES can have its own header file so we can have many of them without
rebuilding everything AES-related whenever one of them changes.

(Planning to add AES-CCM and AES-GCM too.)
2020-07-25 22:14:35 +00:00
riastradh 518b19bb88 Split aes_impl declarations out into aes_impl.h.
This will make it less painful to add more operations to struct
aes_impl without having to recompile everything that just uses the
block cipher directly or similar.
2020-07-25 22:12:56 +00:00
riastradh 4ade9e2cef Invert some loops to save a jmp instruction on each iteration.
No semantic change intended.
2020-07-25 22:11:05 +00:00
riastradh 83e1ef0033 Tweak VIA CPU RNG.
- Cite source for documentation.
- Omit needless kpreempt_disable/enable.
- Explain what's going on.
- Use "D"(out) rather than "+D"(out) -- no REP so no register update.
- Fix interpretation of number of bytes returned.

The last one is likely to address

[   4.0518619] aes: VIA ACE
....
[  11.7018582] cpu_rng via: failed repetition test
[  12.4718583] entropy: ready

reported by Andrius V.
2020-07-25 22:10:34 +00:00
jmcneill 70370e75d4 evbmips: add ofctl(8) and /dev/openfirm support 2020-07-24 12:07:09 +00:00
jdolecek 9967176af4 <xen/xenio.h> is in fact used by the newly imported xentools 4.13,
reinstantiate it

header is for use by xentools only, which define domid_t themselves,
so it should not be a problem the header doesn't define it per PR port-xen/52874
2020-07-24 06:12:21 +00:00
skrll 003a43716e Replace the */ I accidentally removed in the last commit 2020-07-24 05:26:37 +00:00
skrll 0735f8c00d unifdef -U_LKM 2020-07-23 19:26:34 +00:00
skrll 8725c13fcf Trailing whitespace 2020-07-23 19:26:00 +00:00
skrll c18d55d431 unifdef -U_LKM 2020-07-23 19:22:13 +00:00
skrll 56d53108a7 Trailing whitespace 2020-07-23 19:20:02 +00:00
skrll 4cd80e9208 unifdef -U_LKM 2020-07-23 19:07:01 +00:00
skrll 8a1bed9883 unidef -U_LKM 2020-07-23 19:04:03 +00:00
jdc 593e3be579 Move machine-specific fixes into separate functions to improve readability. 2020-07-23 16:08:02 +00:00
skrll 31321092b2 Add a comment to CACHE_LINE_SIZE / COHERENCY_UNIT size defines 2020-07-23 15:24:37 +00:00
skrll f449053743 Reduce the window of having interrupts disabled in cpu_switchto{,_softint}
and ensure astpending is checked with interrupts disabled.
2020-07-23 13:12:54 +00:00
skrll f555790d15 On second thoughts this can't be conditional so define CACHE_LINE_SIZE /
COHERENCY_UNIT as 128 for all mips.
2020-07-23 12:15:59 +00:00
skrll 0cc06bad61 Define CACHE_LINE_SIZE / COHERENCY_UNIT as 128 for MIPS64_OCTEON 2020-07-23 12:13:25 +00:00
ryo 38b81509c9 fix build with llvm/clang. 2020-07-23 11:33:01 +00:00
jdolecek 8ea7677080 enable -Walloca, warn if something uses alloca() 2020-07-22 19:37:59 +00:00
riastradh 0ccb489b47 bwfm: Switch from pcq to pool_cache.
pcq_get is required to be serialized, but it's far from clear that it
is serialized here.
2020-07-22 17:23:52 +00:00
riastradh e49ddcb24e Sort includes. Nix trailing whitespace.
No functional change intended.
2020-07-22 17:23:12 +00:00
riastradh 3028014cb8 Need <sys/kmem.h> for kmem_*.
Currently accidentally side-loaded by <sys/pcq.h>.
2020-07-22 17:22:43 +00:00
riastradh 3b2b3d456b Add include guards and appropriate includes to bwfmreg.h, bwfmvar.h.
No functional change intended.
2020-07-22 17:21:25 +00:00
riastradh bdc07cff2c Sort #includes. Nix trailing whitespace.
No functional change intended.
2020-07-22 17:18:10 +00:00
riastradh 487ce959a3 Omit needless <sys/pcq.h>. 2020-07-22 17:17:36 +00:00
jmcneill 1750621a1e Initialize PageMask and Wired registers on secondary processors. 2020-07-22 15:01:18 +00:00
jmcneill 3be0b0f961 Handle IPI_KPREEMPT 2020-07-22 15:00:49 +00:00
simonb 032f1363cc Add option to use the early bitbang console. Enable this for now
while debugging MP.
Print out the core mask value passed in by Uboot.
2020-07-22 13:24:17 +00:00
riastradh fc73d968be Fix register name in comment.
Some time ago I reallocated the registers to avoid inadvertently
clobbering the callee-saves v9, but neglected to update the comment.
2020-07-22 06:15:21 +00:00
msaitoh 984bb2b315 s/reseting/resetting/ 2020-07-22 01:24:39 +00:00
pgoyette 95e145a85a Remove spurious call to canloopinit() in an attempt to fix kern/55489
This attempt at fixing is a result of IRC discussions with martin@ and
riastradh@
2020-07-21 18:38:18 +00:00
thorpej 13dd0fa419 Sort op_mskqh, op_insqh, and op_extqh. 2020-07-21 13:37:18 +00:00
rin 87dfc27289 Align tmpstk to 4-byte boundary in the same manner as mac68k.
However, unfortunately, this does not fix strange crashes of GCC8-compiled
kernel, for which I cannot even enter DDB nor obtain crash dump.

We need further investigation...
2020-07-21 06:39:31 +00:00
rin f0f5c33535 For GCC8, do not omit frame pointer for intr_dispatch() and via1_intr()
(-fomit-frame-pointer is enabled for -O and higher for GCC8).

This is required by rtclock_intr() which unwinds stack frame of caller!

XXXXXX
We need to get rid of this hackest hack for rtclock_intr(). This problem
was discussed back in 2014:

http://mail-index.netbsd.org/port-mac68k/2014/08/15/msg000595.html
http://mail-index.netbsd.org/port-mac68k/2014/08/17/msg000600.html
http://mail-index.netbsd.org/port-mac68k/2014/08/17/msg000601.html

However, unfortunately, the problem has been left untouched until today.

The patch attached in the third message works around the problem. But,
it adds hard-coded magic numbers to intr_dispatch() and via1_intr().
For real fix, we should probably reconsider whole interrupt handling.

Anyway, now kernel compiled by GCC8 works fine as far as I can see.
2020-07-21 06:10:26 +00:00
simonb 04478e2260 Support "boot -1" to start an MP kernel in uniprocessor mode.
Sort sys/* includes while here.
2020-07-21 06:01:10 +00:00