Commit Graph

113158 Commits

Author SHA1 Message Date
jmcneill
a4ead07a0f check return value of write, make sure we send the whole buffer to stdout 2011-12-20 21:35:16 +00:00
dyoung
112aac83da Mark all of the Rx descriptor fields 'volatile' so that the compiler
will not re-order accesses.  Some versions of GCC (such as one in NetBSD
5.x) definitely do re-order reads from these fields if they're not
marked volatile.
2011-12-20 21:27:29 +00:00
jmcneill
4cb64fe02b set machine_arch to that of the host 2011-12-20 21:26:37 +00:00
jmcneill
d13b2de961 thunk_pollchar: use read instead of getchar 2011-12-20 21:07:56 +00:00
jmcneill
34e2106021 get rid of urkelvisor, and use same MD majors as the host 2011-12-20 21:01:39 +00:00
reinoud
39568060d0 If we need to set the PK_CHKNOSYSCALL flag in struct proc be so nice to first
take the mutex. Tnx for pointing it out to me.
2011-12-20 19:49:36 +00:00
apb
4309071985 Put the path to the compat/common directory in a .PATH line, not in
an element of the SRCS list.  This should fix a problem in which build
products were created in the source tree.

Also add a comment about where COMPAT_50 is defined.
2011-12-20 17:09:04 +00:00
hannken
872808dec2 Move the diagnostic check for a missing VOP_CLOSE() to the top of vrelel().
As long as we hold the vnode interlock there is no chance for this vnode
to gain new references.

Fixes false alarms observed by Thor Lancelot Simon and reported on tech-kern.

Ok: David Holland <dholland@netbsd.org>
2011-12-20 16:49:37 +00:00
drochner
5cc2549c59 allow kernels w/o COMPAT_50 to build 2011-12-20 16:38:06 +00:00
reinoud
a87f342047 Use to the MAP_NOSYSCALLS argument to mmap() to allow for NetBSD/usermode to
execute bog-standard native programs.
2011-12-20 15:45:36 +00:00
reinoud
85475f9fdb Add int $80 and sysenter opcodes to the x86 SIGILL opcode detector 2011-12-20 15:43:51 +00:00
reinoud
1e4a845e20 Part 2 - x86 implementation of MAP_NOSYSCALLS
Currently the MAP_NOSYSCALLS is only implemented for x86 but other
architectures are easy to adapt; see the sys/arch/x86/x86/syscall.c patch.
Port maintainers are encouraged to add them for their processor ports too.
When this feature is not yet implemented for an architecture the
MAP_NOSYSCALLS is simply ignored with virtually no cpu cost..
2011-12-20 15:41:50 +00:00
reinoud
ea698f7362 Ooops forgot the uvm_map.h 2011-12-20 15:41:01 +00:00
reinoud
d131102a3b Add a MAP_NOSYSCALLS flag to mmap. This flag prohibits executing of system
calls from the mapped region. This can be used for emulation perposed or for
extra security in the case of generated code.

Its implemented by adding mapping-attributes to each uvm_map_entry. These can
then be queried when needed.

Currently the MAP_NOSYSCALLS is only implemented for x86 but other
architectures are easy to adapt; see the sys/arch/x86/x86/syscall.c patch.
Port maintainers are encouraged to add them for their processor ports too.
When this feature is not yet implemented for an architecture the
MAP_NOSYSCALLS is simply ignored with virtually no cpu cost..
2011-12-20 15:39:35 +00:00
yamt
49cf653167 comment and assertion 2011-12-20 13:47:38 +00:00
apb
aed644df58 Revert previous; the #include was already present, and I got confused
by a merge error.
2011-12-20 13:42:19 +00:00
jmcneill
a4dec04e60 from http://www.freshbsd.org/commit/openbsd/ae7f934ae5bdf57dcf3431ba55fd1da93b8f1963
Initialize abridged tag word properly. x87 spec says FNINIT says tag word
contains FFFFh (all stack locations empty) which would make abridged tag
word 00h. From the Intel 64 and IA-32 Architectures Software Developer's
Manual:

"The FXSAVE instruction saves an abridged version of the x87 FPU tag word
in the FTW field (unlike the FSAVE instruction, which saves the complete
tag word). The tag information is saved in physical register order (R0
through R7), rather than in top-of- stack (TOS) order. With the FXSAVE
instruction, however, only a single bit (1 for valid or 0 for empty) is
saved for each tag."

ok rmind@
2011-12-20 13:17:05 +00:00
apb
69662c7cbb #include "opt_compat_netbsd.h" 2011-12-20 12:45:00 +00:00
apb
e48fd3a0e7 SRCS += ${.CURDIR}/../../../../compat/common/rndpseudo_50.c
to fix build errors like this:

DESTDIR/usr/lib/librumpdev_rnd.so: undefined reference to
`rumpns_compat_50_rnd_ioctl'
2011-12-19 21:56:18 +00:00
apb
381a814261 Add COMPAT_50 and COMPAT_NETBSD32 compatibility code for rnd(4)
ioctl commands.

Tested with "rndctl -ls" using an old 32-bit version of rndctl(8)
(built for NetBSD-5.99.56/i386) and a new 64-bit kernel
(NetBSD-5.99.59/amd64).
2011-12-19 21:53:52 +00:00
apb
7c0101b055 Return ENOTTY, not EINVAL, when the ioctl command is unrecognised. 2011-12-19 21:44:08 +00:00
jakllsch
30508d772a It's tp->t_dev, not tp->tp_dev. Corrects commit prior to previous. 2011-12-19 19:39:51 +00:00
jakllsch
5726d07be3 const-ify struct ucom_methods pointer within ucom(4). 2011-12-19 19:34:52 +00:00
jakllsch
1feeb5b4aa Make commented-out code in ucomstop() compilable. 2011-12-19 19:30:12 +00:00
cherry
0759560962 Add knob to turn MULTIPROCESSOR build on for XEN 2011-12-19 19:09:16 +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
jmcneill
4c310252d5 for analog devices codecs, mark the analog beeper pin as a beep generator
to help the parser. makes pcppi beep work again.
2011-12-19 12:19:26 +00:00
drochner
23e5beaef1 rename the IPSEC in-kernel CPP variable and config(8) option to
KAME_IPSEC, and make IPSEC define it so that existing kernel
config files work as before
Now the default can be easily be changed to FAST_IPSEC just by
setting the IPSEC alias to FAST_IPSEC.
2011-12-19 11:59:56 +00:00
drochner
25b72c320c as in netkey/key.c, just use cprng_fast() to get a random number
(which is used to choose an SPI), kill the dummy seeding code
2011-12-19 11:47:16 +00:00
drochner
f8ac16bb44 make this build with RND_DEBUG 2011-12-19 11:10:08 +00:00
skrll
be4563b037 Whitespace. 2011-12-19 10:56:59 +00:00
christos
8ddb33d2b3 don't produce different output if we are super user. 2011-12-19 03:02:31 +00:00
christos
2e4fce7c78 Fix monotonic interval timers. 2011-12-18 22:30:25 +00:00
phx
e4739f1ffc Replaced conf_args by mainbus_attach_args. 2011-12-18 14:28:59 +00:00
kiyohara
0d7ee07ee9 SYMTAB_SPACE. 2011-12-18 11:10:33 +00:00
tsutsui
cd383d3880 Restore __HAVE_MM_MD_READWRITE which was added for 5.99.53 in rev 1.14
but removed by merge botch on __HAVE_NEW_STYLE_BUS_H changes in rev 1.15.

Fixes "/dev/nvram: Device not configured" problem on installboot(8)
reported by David Ross.
2011-12-18 09:12:18 +00:00
dholland
7bbf82b772 WABPL is no longer considered experimental (has not been for some time)
so update its comment in config files.
2011-12-18 05:49:22 +00:00
tsutsui
6bb63ff72f Explicitly specify -m68020-60 to avoid possible 060SP instructions,
especially 64 bit integer mul/div ops in standalone bootloaders. From x68k.
2011-12-18 04:51:12 +00:00
tsutsui
d2d118fe98 Misc KNF and cosmetics. No binary changes. 2011-12-18 04:29:32 +00:00
tsutsui
09525416c6 PR port-next68k/45719 from Jaime Fournier:
Fix RELOC() (awful VA -> PA conversion) usage introduced to appease gcc45
 in rev 1.22.
2011-12-18 03:46:02 +00:00
dholland
12f78b170e adjust English usage in comment 2011-12-18 02:31:51 +00:00
kiyohara
c2cb48eba7 SYMTAB_SPACE. 2011-12-18 01:12:55 +00:00
phx
9a274f082f Added NOR flash driver, using nor(4) and flash(4). 2011-12-17 20:20:37 +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
phx
9a36cd1663 - In cfi_probe() iterate over all chip widths for every port width to find
x8/x16 configurations, or two x8 chips forming a x16 port width.
- The offset in cfi_cmd() is now always given for 64-bit port width.
  It will be scaled down for the actual port width to avoid problems
  with 0x2aa -> 0x554 instead of 0x555.
- Added missing cfi_reset_default() in cfi_jedec_id(). The reset is
  needed, because the chip was still in CFI-Query mode.
- Removed everything dealing with cfi_opmodes. It only complicates things
  and I found no reason for keeping them. The port width and chip width
  is known, so I just introduced a new cfi_read_qry() function which reads
  a single word using bus_space_read_N() from the QRY structure, which
  can be checked for 'Q', 'R' and 'Y'. That's all we need, before
  reading and unpacking the whole QRY and PRI structures.
- Added two new fields, cfi_unlock_addr1 and cfi_unlock_addr2 to
  the cfi struct. The unlock offsets should be kept variable, depending
  on the manufacturer or command set version.

Changes have been discussed with cliff@.
2011-12-17 19:42:41 +00:00
phx
a88be5a1e4 Allow defining a bus space with pbs_limit=0, which will have the effect to
create a space which ends with 0xffffffff.
This is needed, because pbs_limit=0xffffffff ends the space with 0xfffffffe.
2011-12-17 19:34:07 +00:00
kiyohara
1a43c47f50 Fix panic early call rasops_init(). Move into arcvideo_attach().
Also early attach arcvideo.
2011-12-17 14:51:07 +00:00
apb
2066dd1e26 Add comments for some ioctls and structs; fix a typo in another comment. 2011-12-17 12:59:21 +00:00
he
eb489fae8a Commit regenerated configuration file after COPTS=-Os shuffle. 2011-12-17 12:45:14 +00:00