Commit Graph

1515 Commits

Author SHA1 Message Date
matt 7877a7bda7 Add xhci placeholder 2012-09-01 11:21:22 +00:00
joerg c14f2d4ef8 Deal with optional HAVE_GCC. 2012-08-10 16:05:26 +00:00
matt 13efa83b82 compat_mod is also needed by compat_netbsd32 2012-08-03 07:41:47 +00:00
rmind 1f86dc56b4 Add BPF JIT compiler, currently supporting amd64 and i386. Code obtained
from FreeBSD.  Also, make few BPF fixes and simplifications while here.
Note that bpf_jit_enable is false for now.

OK dyoung@, some feedback from matt@
2012-08-01 23:24:28 +00:00
bouyer 9edd4d81c5 Apply back changes that were reverted on Jul 24 and Jul 26 (general ata/wdc
cleanup and SATA PMP support), now that I'm back to fix the fallouts.
2012-07-31 15:50:31 +00:00
degroote aead3000b0 Add malo(4)@pci driver for Marvell Libertas wireless adaptor
Ported from OpenBSD
Known issues :
  - contrary to OpenBSD one, only support pci at the moment, because I don't
    have the necessary hardware to test PCMCIA / CARDUS Marvell Card
  - not connected to pmf(9) (unable to test it)
2012-07-30 18:57:17 +00:00
matt 2b5bbd5317 Enable -fno-common for GCC compiled kernels 2012-07-27 05:40:51 +00:00
jakllsch 102f7b2016 Revert, with intention of restoring in a less invasive way, the SATA Port
Multiplier code.

ok christos@
2012-07-26 20:49:44 +00:00
bouyer 03c9df05c6 Add sata Port MultiPlier (PMP) support to the ata bus layer,
as described in
http://mail-index.netbsd.org/tech-kern/2012/06/23/msg013442.html
PMP support in integrated to the atabus layer.
struct ata_channel's ch_drive[] is not dynamically allocated, and ch_ndrive
(renamed to ch_ndrives) closely reflects the size of the ch_drive[] array.
Add helper functions atabus_alloc_drives() and atabus_free_drives()
to manage ch_drive[]/ch_ndrives.
Add wdc_maxdrives to struct wdc_softc so that bus front-end can specify
how much drive they really support (master/slave or single).
ata_reset_drive() callback gains a uint32_t *sigp argument which,
when not NULL, will contain the signature of the device being reset.
While there, some cosmetic changes:
- added a drive_type enum to ata_drive_datas, and stop encoding the
  probed drive type in drive_flags (we were out of drive flags anyway).
- rename DRIVE_ATAPIST to DRIVE_ATAPIDSCW to better reflect what this
  really is
- remove ata_channel->ata_drives, it's redundant with the pointer in
  ata_drive_datas
- factor out the interpretation of SATA signatures in sata_interpet_sig()

propagate these changes to the ATA HBA drivers, and add support for PMP
to ahcisata(4) and siisata(4).

Thanks to:
- Protocase (http://www.protocase.com/) which provided a system
  with lots of controllers, SATA PMP and drive slots
- Conservation Genomics Laboratory, Department of Biology, New Mexico State
  University for hosting the above system
- Brook Milligan, who set up remote access and has been very responsive
  when SATA cable move was needed
2012-07-02 18:15:44 +00:00
christos 0461089547 Add a new resource to limit the number of lwps per user, RLIMIT_NTHR. There
is a global sysctl kern.maxlwp to control this, which is by default 2048.
The first lwp of each process or kernel threads are not counted against the
limit. To show the current resource usage per user, I added a new sysctl
that dumps the uidinfo structure fields.
2012-06-09 02:31:14 +00:00
riastradh 5ecfdf8dea Implement a genfs_rename abstraction.
First major step in incrementally adapting all the file systems to a
saner rename VOP protocol.
2012-05-08 23:53:26 +00:00
rmind 269014127a G/C POOL_DIAGNOSTIC option. No objection on tech-kern@. 2012-05-05 19:15:10 +00:00
rmind 4b760398c3 Remove MALLOC_DEBUG and MALLOCLOG, which is dead code after malloc(9) move
to kmem(9).  Note: kmem(9) has debugging facilities under DEBUG/DIAGNOSTIC.
However, expensive kmguard and debug_freecheck have to be enabled manually.
2012-04-28 23:03:39 +00:00
christos 9836ec4b63 Add apple autodiscovery. 2012-04-07 05:36:49 +00:00
martin 997712ca59 Redo rev 1.154 by using an explicit MKSHNOECHO that does not output anything. 2012-03-25 09:15:20 +00:00
joerg 0e8643658c Don't pass assembler flags to genassym, it doesn't compile. 2012-03-25 06:55:19 +00:00
uebayasi f464a5fd74 Don't print blank lines when !CTFCONVERT. 2012-03-25 01:56:02 +00:00
drochner 364a06bb29 remove KAME IPSEC, replaced by FAST_IPSEC 2012-03-22 20:34:37 +00:00
bsh f4eb9f64cb adjust the size of db_symtab space automatically.
proposed on tech-toolchain@, and got no objections.
2012-03-19 05:38:26 +00:00
joerg 99c3eea80c P1003_1B_SEMAPHORE is no longer optional. 2012-03-10 21:51:48 +00:00
rmind ad12c77015 Remove COMPAT_SA / KERN_SA. Welcome to 6.99.3!
Approved by core@.
2012-02-19 21:05:51 +00:00
christos f347d465be Add new -k (for kernel modules) flag to return MM.99.pp for current and MM.mm
for the release branch.
2012-02-16 23:56:57 +00:00
christos 647ed7be84 Don't eat _BETA. I am sure dsl will come up with something more elegant. 2012-02-16 17:25:35 +00:00
matt 1d7f24ead8 Change old-style function defintions to C89 prototypes.
Approved by releng.
2012-02-12 16:34:06 +00:00
christos 1c2efa29c7 -Wold-style-definitions for i386 and amd64 2012-02-03 23:39:26 +00:00
tls 7b0b7dedd9 Entropy-pool implementation move and cleanup.
1) Move core entropy-pool code and source/sink/sample management code
   to sys/kern from sys/dev.

2) Remove use of NRND as test for presence of entropy-pool code throughout
   source tree.

3) Remove use of RND_ENABLED in device drivers as microoptimization to
   avoid expensive operations on disabled entropy sources; make the
   rnd_add calls do this directly so all callers benefit.

4) Fix bug in recent rnd_add_data()/rnd_add_uint32() changes that might
   have lead to slight entropy overestimation for some sources.

5) Add new source types for environmental sensors, power sensors, VM
   system events, and skew between clocks, with a sample implementation
   for each.

ok releng to go in before the branch due to the difficulty of later
pullup (widespread #ifdef removal and moved files).  Tested with release
builds on amd64 and evbarm and live testing on amd64.
2012-02-02 19:42:57 +00:00
macallan 0a201d5d34 igsfb doesn't use rcons, no need to pull it in 2012-01-31 05:08:14 +00:00
dholland 749c2c6e19 Add vfs_quotactl.c. This is where filesystem-independent quota
handling will go.
2012-01-29 06:26:54 +00:00
nisimura cbcafca122 Add UDA1341TS audio CODEC support. Code is written by
Paul Fleischer.
2012-01-28 08:37:22 +00:00
christos 6fb39d18da add a tpm driver from bsssd.sourceforge.net 2012-01-22 06:44:28 +00:00
drochner 40e8e4a37d also remove unnecessary "needs-flag" for firmload, from Paul Goyette 2012-01-19 16:35:24 +00:00
drochner bb133a10ef get the logics straight: CPU_UCODE requires "firmload" as a dependency 2012-01-18 20:37:20 +00:00
pgoyette f7607cb2ae options CPU_UCODE requires firmload.c 2012-01-14 04:18:49 +00:00
martin e485c8dbaa Make option CPU_UCODE global 2012-01-13 21:46:00 +00:00
riz c1792eb47d Welcome to 2012, Happy New Year!
Don't forget to adjust copyright date in new code.
2012-01-01 00:00:30 +00:00
drochner 496df2a91f do missing ipsec->kame_ipsec renames 2011-12-19 16:10:07 +00:00
joerg 417b55d96e Move Clang-warning flags for ah_regdomain.c into sys/conf, they are
platform independent. Use the selective -Wno-* flags instead of
-Wno-error.
2011-12-19 14:06:16 +00:00
tls 6e1dd068e9 Separate /dev/random pseudodevice implemenation from kernel entropy pool
implementation.  Rewrite pseudodevice code to use cprng_strong(9).

The new pseudodevice is cloning, so each caller gets bits from a stream
generated with its own key.  Users of /dev/urandom get their generators
keyed on a "best effort" basis -- the kernel will rekey generators
whenever the entropy pool hits the high water mark -- while users of
/dev/random get their generators rekeyed every time key-length bits
are output.

The underlying cprng_strong API can use AES-256 or AES-128, but we use
AES-128 because of concerns about related-key attacks on AES-256.  This
improves performance (and reduces entropy pool depletion) significantly
for users of /dev/urandom but does cause users of /dev/random to rekey
twice as often.

Also fixes various bugs (including some missing locking and a reseed-counter
overflow in the CTR_DRBG code) found while testing this.

For long reads, this generator is approximately 20 times as fast as the
old generator (dd with bs=64K yields 53MB/sec on 2Ghz Core2 instead of
2.5MB/sec) and also uses a separate mutex per instance so concurrency
is greatly improved.  For reads of typical key sizes for modern
cryptosystems (16-32 bytes) performance is about the same as the old
code: a little better for 32 bytes, a little worse for 16 bytes.
2011-12-17 20:05:38 +00:00
tls 8a012bd83f The rnd pseudo-device is not really optional, because it is in the same
source file as the entropy-pool code itself.  Move it to std.  This
will be cleaned up more when I split the sources up as they should be.

This fixes build breaks on several ports.  Thanks to Havard Eidnes for
pointing them out.
2011-11-22 21:25:05 +00:00
tls 3afd44cf08 First step of random number subsystem rework described in
<20111022023242.BA26F14A158@mail.netbsd.org>.  This change includes
the following:

	An initial cleanup and minor reorganization of the entropy pool
	code in sys/dev/rnd.c and sys/dev/rndpool.c.  Several bugs are
	fixed.  Some effort is made to accumulate entropy more quickly at
	boot time.

	A generic interface, "rndsink", is added, for stream generators to
	request that they be re-keyed with good quality entropy from the pool
	as soon as it is available.

	The arc4random()/arc4randbytes() implementation in libkern is
	adjusted to use the rndsink interface for rekeying, which helps
	address the problem of low-quality keys at boot time.

	An implementation of the FIPS 140-2 statistical tests for random
	number generator quality is provided (libkern/rngtest.c).  This
	is based on Greg Rose's implementation from Qualcomm.

	A new random stream generator, nist_ctr_drbg, is provided.  It is
	based on an implementation of the NIST SP800-90 CTR_DRBG by
	Henric Jungheim.  This generator users AES in a modified counter
	mode to generate a backtracking-resistant random stream.

	An abstraction layer, "cprng", is provided for in-kernel consumers
	of randomness.  The arc4random/arc4randbytes API is deprecated for
	in-kernel use.  It is replaced by "cprng_strong".  The current
	cprng_fast implementation wraps the existing arc4random
	implementation.  The current cprng_strong implementation wraps the
	new CTR_DRBG implementation.  Both interfaces are rekeyed from
	the entropy pool automatically at intervals justifiable from best
	current cryptographic practice.

	In some quick tests, cprng_fast() is about the same speed as
	the old arc4randbytes(), and cprng_strong() is about 20% faster
	than rnd_extract_data().  Performance is expected to improve.

	The AES code in src/crypto/rijndael is no longer an optional
	kernel component, as it is required by cprng_strong, which is
	not an optional kernel component.

	The entropy pool output is subjected to the rngtest tests at
	startup time; if it fails, the system will reboot.  There is
	approximately a 3/10000 chance of a false positive from these
	tests.  Entropy pool _input_ from hardware random numbers is
	subjected to the rngtest tests at attach time, as well as the
	FIPS continuous-output test, to detect bad or stuck hardware
	RNGs; if any are detected, they are detached, but the system
	continues to run.

	A problem with rndctl(8) is fixed -- datastructures with
	pointers in arrays are no longer passed to userspace (this
	was not a security problem, but rather a major issue for
	compat32).  A new kernel will require a new rndctl.

	The sysctl kern.arandom() and kern.urandom() nodes are hooked
	up to the new generators, but the /dev/*random pseudodevices
	are not, yet.

	Manual pages for the new kernel interfaces are forthcoming.
2011-11-19 22:51:18 +00:00
agc a5b83a6434 grab major 203 for the iSCSI communications device (between kernel
driver and /sbin/iscsid)
2011-11-19 16:41:55 +00:00
riz 262c7a9290 Build and install new in-kernel iscsi initiator kernel module and associated
binaries (iscsid, iscsictl) if MKISCSI != no.  Initiator can also be built
into a kernel by adding 'pseudo-device iscsi' in kernel configuration.
2011-11-15 16:50:43 +00:00
martin b37874ed85 Add missing subr_pcq.c 2011-11-02 09:47:57 +00:00
tron 364c7183d8 Fix build of kernels without filemon(4). 2011-10-15 10:18:24 +00:00
sjg db4d363da5 Add the plumbing so one could compile filemon(4) into a kernel. 2011-10-15 00:23:08 +00:00
jmcneill ab747348b5 Install dev/i2c/i2c_io.h and implement the API in the iic(4) driver.
Obsolete the I2C_SCAN option as this can now be done from userland.
2011-10-02 16:39:45 +00:00
jruoho a179648071 Add a simple cpufreq(9).
This is slightly improved version presented on tech-kern@ with proper
locking and few additional functions, mainly required for ioctl(9)/cpuctl(8).
2011-09-28 10:55:46 +00:00
joerg 41c1da9cfb Allow analyze to work by including bsd.clang-analyze.mk for kernels 2011-09-25 22:26:33 +00:00
jnemeth a55ee38cee dm(4) uses dk_lookup() from dksubr.c 2011-09-19 08:53:30 +00:00
plunky f2d8d4c1c1 for multi-cpu machines, cpu_hatch() straddles the init of
__stack_chk_guard, so ensure stack protection is disabled
on x86 architectures (I don't know about other archs)
2011-08-31 20:16:43 +00:00