Commit Graph

112801 Commits

Author SHA1 Message Date
jym
54f95b1441 Deep rework of the xbdback(4) driver; it now uses a thread per instance
instead of continuations directly from shm callbacks or interrupt
handlers. The whole CPS design remains but is adapted to cope with
a thread model.

This patch allows scheduling away I/O requests of domains that behave
abnormally, or even destroy them if there is a need to (without thrashing
dom0 with lots of error messages at IPL_BIO).

I took this opportunity to make the driver MPSAFE, so multiple instances
can run concurrently. Moved from home-grown pool(9) queues to
pool_cache(9), and rework the callback mechanism so that it delegates
I/O processing to thread instead of handling it itself through the
continuation trampoline.

This one fixes the potential DoS many have seen in a dom0 when trying to
suspend a NetBSD domU with a corrupted I/O ring.

Benchmarks (build.sh release runs and bonnie++) do not show any
performance regression, the "new" driver is on-par with the "old" one.

ok bouyer@.
2011-11-24 01:47:18 +00:00
christos
947906bba8 - fixed signed/unsigned comparison
- don't write/increment sbuf if NULL
2011-11-24 01:45:39 +00:00
christos
2413151944 - don't let arguments in macros have side effects
- nul terminate properly
2011-11-24 01:14:19 +00:00
jmcneill
aef2dcc2bc splaudio is no more 2011-11-24 01:11:04 +00:00
mrg
d4009eded7 note umidi as done 2011-11-23 23:59:32 +00:00
mrg
eabfa83860 complete the port to audiomp: take kernel lock in a few places for
USB (like uaudio), kill most of the spl* uses.
2011-11-23 23:50:46 +00:00
jmcneill
8a962f23f2 Merge jmcneill-audiomp3 branch, which is derived from ad-audiomp2. From
the original ad-audiomp branch notes:

  Add MP locking to the audio drivers.

  Making the audio drivers MP safe is necessary before efforts
  can be made to make the VM system MP safe.

  The are two locks per device instance, an ISR lock and
  a character device lock. The ISR lock replaces calls to
  splaudio()/splx(), and will be held across calls to device
  methods which were called at splaudio() before (e.g.
  trigger_output). The character device lock is held across
  calls to nearly all of the methods, excluding some only
  used for initialization, e.g. get_locks.

Welcome to 5.99.57.
2011-11-23 23:07:28 +00:00
phx
4737c9d893 Make it compile without DEBUG option. 2011-11-23 21:02:28 +00:00
bouyer
d6fd66fef6 If ufs_balloc_range() fails, make sure to call ?fs_truncate() to
reset v_writesize to the right value.
If v_writesize is left larger than the allocated blocks, we may have
the same issue as the one described in
http://mail-index.netbsd.org/tech-kern/2010/02/02/msg007156.html
2011-11-23 19:42:10 +00:00
hannken
b51f84ed74 According to "Virtio PCI Card Specification v0.9.2 DRAFT" there is no
feature named VIRTIO_BLK_F_SECTOR_MAX so remove it.  Linux seems to use
this feature bit as VIRTIO_BLK_F_TOPOLOGY.

Use VIRTIO_BLK_F_BLK_SIZE * VIRTIO_BLK_F_SEG_MAX as the drivers maxxfer
and reorder so sc_secsize gets set before use.

As maxxfer may not be a multiple of page size add one more segment to
the dma maps.

Tested on Linux 3.1.1 host by Guillaume Lasmayous.
2011-11-23 19:40:42 +00:00
hannken
035b1022bb Use hashinit() / hashdone() to create the union node hash list.
Cleanup the hash lookup in union_allocvp().

Needs more work as there is still a possible deadlock between
union_allocvp() and vclean().
2011-11-23 19:39:11 +00:00
nonaka
451b8e69e9 recompile. 2011-11-23 15:51:02 +00:00
nonaka
115cdcb731 modify for PSION NETBOOK PRO.
- ignore "Network" directory when finding the directory for configuration files.
- as the device name "SMC" (SD-MMC) to allow.
- add "SMC1:/" entry to kernel directory.
2011-11-23 15:49:57 +00:00
tls
4924aa205a Load entropy at system boot (only works at securelevel < 1); save
at system shutdown.  Disable with random_seed=NO in rc.conf if desired.

Goes to some trouble to never load or save to network filesystems.

Entropy should really be loaded by the boot loader but I am still
sorting out how to pass it to the kernel.
2011-11-23 10:47:48 +00:00
jym
95925fc068 No more users of xpmap_update(). Use pmap_pte_*() functions now. 2011-11-23 01:16:55 +00:00
jym
5db0fc1679 Kill dependency to xpmap_update(), and use setbits/clearbits to update
kernel PTE rights.
2011-11-23 01:15:02 +00:00
matt
4b00b594fa When allocating a page for a kernel stack and PMAP_ALLOC_POOLPAGE is
defined, use it.  (allows a MIPS N32 kernel to boot when there is memory
outside of KSEG0).
2011-11-23 01:07:50 +00:00
matt
c1be7fc1fe When allocating pages for kernel map entries and PMAP_ALLOC_POOLPAGE is
defined, use it.  (allows a MIPS N32 kernel to boot when there is memory
outside of KSEG0).
2011-11-23 01:00:52 +00:00
jym
1eaed4e6e6 Move Xen-specific functions to Xen pmap. Requested by cherry@.
Un'ifdef XEN in xen_pmap.c, it is always defined there.
2011-11-23 00:56:56 +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
christos
32c78aacbc Increment the source buffer when we overflow so that we don't get stuck in
an infinite loop.
2011-11-22 21:25:04 +00:00
tls
a22a3917ac 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:24:51 +00:00
jakllsch
bc81369a28 Set "mode" to 2 at the correct time.
Fixes recording on some isapnp(4) wss(4) chips.
2011-11-22 19:33:38 +00:00
garbled
0f8d4dff8d Add support to recognize the 8168E model of this chip. Taken from FreeBSD 2011-11-22 18:42:56 +00:00
phx
2ef75c3a2d Print "Model:" information with oea_startup(). 2011-11-22 16:56:29 +00:00
joerg
6133e96c53 Add TLS support for m68k. 2011-11-22 15:25:28 +00:00
tsutsui
439935782f Remove more now unnecessary IIOV() conversion.
XXX: we should have proper PA to VA macro for TT mappings for readability
2011-11-22 14:31:02 +00:00
he
4c9561fdf9 Bump SYMTAB_SPACE so that the symbol table fits again. 2011-11-22 12:11:39 +00:00
macallan
19166a6288 NIST_CTR_DRBG.V is accessed as (unsigned long *) so we need to make sure
it's aligned accordingly or we go boom on sparc64
2011-11-21 23:48:52 +00:00
njoly
63da447932 Adjust setup_linux_rt_sigframe/setup_linux_sigframe prototypes. 2011-11-21 22:00:42 +00:00
christos
abbdc04fd6 - don't clear the flags twice in the loop
- reorder calculation to preserve as much precision as possible.
2011-11-21 19:50:37 +00:00
hannken
4e825063cf Replace flag based union node locking with generic vnode lock, support
shared and nowait locks and protect un_uppervp and un_*sz with mutex.

Mark file system MPSAFE.
2011-11-21 18:29:22 +00:00
tsutsui
7e10f851ee Include MD <machine/cpu_counter.h> only if defined(__HAVE_CPU_COUNTER).
XXX: Why not timecounter(9) but deprecated cpu_counter32() and microtime(9)?
2011-11-21 13:44:38 +00:00
tsutsui
73f3cca235 No need to include MD <machine/cpu_counter.h> here. 2011-11-21 13:42:37 +00:00
hannken
026265a4d0 Add missing fstrans_done().
Should fix PR #45635 (KASSERT "fli->fli_trans_cnt == 0" failed)
2011-11-21 10:46:56 +00:00
hannken
0114172335 nfsrv_lookup(): Defer the postopattr lookup on dirp until the
child node is unlocked.

Ok: YAMAMOTO Takashi <yamt@netbsd.org>
2011-11-21 09:07:59 +00:00
christos
64afb694ee change printf gcc attribute to __printflike(), requested by joerg. 2011-11-21 04:36:05 +00:00
christos
9873d290d6 - use va_copy where needed
- always nul terminate vsnprintf()
- make snprintf() call vsnprintf()
2011-11-21 01:44:26 +00:00
christos
17877341be add more missing printf attributes. 2011-11-20 23:37:00 +00:00
christos
3f19719796 snprintf/vsnprintf can accept NULL/0 buffers and work properly as expected.
Before they used to return incorrect length on short buffers. Remove unused
error path.
2011-11-20 23:01:18 +00:00
christos
a548e427f9 simplify, no need for va_copy here. Add KASSERT. 2011-11-20 22:58:31 +00:00
christos
51f50a4d9f mark printf function 2011-11-20 22:50:12 +00:00
gavan
6c2570459b Implement timeouts when blocking the calling process with tsleep.
Fixes PR kern/33452
2011-11-20 22:27:39 +00:00
dholland
c60360c18d Reshuffle decls among the quota headers so everything is in the place
it should be:
   - stuff for the proplib interface goes in <quota/quotaprop.h>
   - stuff for userlevel only goes in <quota/quota.h>
   - stuff shared between user and kernel goes in <sys/quota.h>

Note that <quota/quota.h> and <quota/quotaprop.h> are expected to be
moved or removed later on... one thing at a time.

Update include directives in other files as needed.
2011-11-20 21:43:34 +00:00
apb
0131e55685 Use va_copy to avoid undefined behaviour in handling the
va_list arg.
2011-11-20 21:27:26 +00:00
jym
6bfeabc65a Expose pmap_pdp_cache publicly to x86/xen pmap. Provide suspend/resume
callbacks for Xen pmap.

Turn static internal callbacks of pmap_pdp_cache.

XXX the implementation of pool_cache_invalidate(9) is still wrong, and
IMHO this needs fixing before -6. See
http://mail-index.netbsd.org/tech-kern/2011/11/18/msg011924.html
2011-11-20 19:41:27 +00:00
yamt
6894cdda89 revert machdep.c rev. 1.168 because it's likely to have the same problem
as i386's one.
http://mail-index.NetBSD.org/source-changes-d/2011/11/19/msg004283.html
2011-11-20 18:42:56 +00:00
yamt
fbc189d43b revert dumpsys.c rev. 1.13 because it was reported to cause a problem.
http://mail-index.NetBSD.org/source-changes-d/2011/11/19/msg004283.html
2011-11-20 18:41:12 +00:00
tsutsui
217e34e4b6 Add preliminary PROM internal function based framebuffer console support,
which was demonstrated at Open Source Conference 2011 Kansai @ Kyoto
back in July:
http://www.NetBSD.org/gallery/events.html#opensourceconf2011-Kansai

- map 0xc0000000-0xffffffff PA region (which is mirror of PA 0x0-0x3fffffff)
  to the same VA via %tt0 and %tt1 registers and move KVA space accordingly
  (like luna68k does for its devices)
- save trap #0 vector for PROM function calls in early bootstrap
  and register it to trap #14 to call it from kernel for console output
- add dumb romcall based tty attachment taken from src/sys/dev/ofw/ofcons.c
- add rom function call stubs from news68k/stand/common/romcalls.S
- remove IIOV() macro for device registers where now mapped PA==VA via %tt1

XXX: romcons is not enabled yet because there is no generic interface
XXX: to attach wskbd(4) to non wsdisplay(4) devices like this romcons.
2011-11-20 15:38:00 +00:00
para
4255d01378 make it compile without DIAGNOSTIC defined 2011-11-20 15:37:31 +00:00