4484 Commits

Autor SHA1 Mensagem Data
Jeff Brown d683297810 [trace-engine] Fix bug writing arguments within inline names.
Change-Id: I5cbaa3cec12c0423546e3e6db76d8bea9257cfea
2017-09-12 17:36:11 +00:00
Andrew Krieger 6534d9a705 [virtio][entropy] Basic virtio-rng driver
The driver draws entropy from the host system on qemu. Since there
isn't a mechanism for the kernel to pull entropy from the driver or to
control the driver's rate of activity, for now the driver just launches
its own thread to push entropy to the kernel periodically.

Change-Id: I950518db4a5776f041856b05ad0277b970aa6bc5
2017-09-12 17:14:47 +00:00
Sean Klein fc4f6529c2 [fs] Add threading tests attempting to provoke races in filesystems
Change-Id: I84ac84b9701485824ef21b4066154221a2bd6e78
2017-09-12 17:09:50 +00:00
Brian Swetland 348b43755a [mxio][ns] wire up mxio_ns_install()
Currently it only supports installation in processes without
an active namespace, but that's the only place we need to do
this right now.

Change-Id: If6cdc2a14cd6a654d491019afd92016655022287
2017-09-11 23:29:35 -07:00
Brian Swetland 54b8648a7b [devmgr][memfs] enable pipeline-style connections to the root fs
Change-Id: I5eebb05ef28b77823826d868b50870f918f99395
2017-09-11 23:29:35 -07:00
Andy Mutton 4729739f9a [hypervisor] Uart changes for interactive magenta.
Offloads tx output to another thread.
Passes TERM=uart to magenta, making linenoise skip console width check.
Make cnd_vars a little more sensible.

From this point, further work is optional.

Change-Id: I7dc4758f204057273d0444b93dc82325a45a7a7f
2017-09-12 06:26:57 +00:00
Brian Swetland c80a921bc0 [userboot][loader] politely decline clone requests
The userboot loader is intended to only bootstrap the first
process (usually devmgr) and does not support multiple clients.

Change-Id: I051858bf93ca2d7ea59f716a4179807c7f030a70
2017-09-12 01:26:27 +00:00
Brian Swetland f729a2d6ca [loader-service] provide op for cloning service connections
A process that has access to a loader will be able to use
this to obtain a new loader connection suitable for handing
off to a child -- similar to how other services, filesystem
objects, etc can be cloned.

This will allow us to eliminate the use of /dev/misc/dmctl
to obtain a global "system loader" connection.

Change-Id: Ifb92478132ca4e9793020be2f0bf853284198830
2017-09-12 00:49:11 +00:00
Jeff Brown 04058351c3 [async] Amend readme to mention auto_wait and auto_task.
Change-Id: Iec7f13b21658e1b973a67e27a1b1976ec32add42
2017-09-12 00:34:25 +00:00
Tim Detwiler 9e0ed8e013 [hypervisor][vcpu] MMIO access refactor.
Migrate most of the logic for interacting with decoded instructions
into vcpu and out of the device implementations. The VCPU will dispatch
the appropriate read/write request based on the decoded instruction and
then handle updating any required VCPU state.

The new handle_mmio_read/handle_mmio_write functions in vcpu.cpp are
the MMIO counterparts to the existing handle_input/handle_output
methods that implement IO port accesses.

Change-Id: I7a41c2ecb32871d8ebf4568951a5c9cc8f9d3a12
2017-09-11 23:36:51 +00:00
Mark Seaborn 88d7aeb2b3 [utest][x86] Add test for zeroing of segment selector registers
We expect the segment selector registers to get zeroed on interrupts
and on context switches.  The former is done by the CPU and the latter
is done by some logic in kernel/arch/x86/thread.cpp (which did not
have test coverage before).

Change-Id: Ia6940f311bf00fa96f8021cf05a896c2955339ed
2017-09-11 22:54:25 +00:00
Doug Evans 539810232f [utest][debugger] Refactor wait-inferior thread worker
... and move handling of all exceptions into client.
Plus misc minor cleanup.

Change-Id: Ibb90aa70f95c8198babcebed1427c1f9d3fb0cf7
2017-09-11 15:25:24 -07:00
Tim Detwiler d555308f58 [hypervisor] Normalize types for IO operations.
Most of these functions don't care if the access is caused by a memory
trap or an IO instruction. This change normalizes on the mx_vcpu_io_t
structure for IO handlers as it's the simplest structure to describe a
sized value.

Change-Id: I9286dc03e55f3c9e25acac0c11567d8bfbce8f39
2017-09-11 21:40:21 +00:00
Sergey Ulanov 78eb710bbc [mxio] set MSG_TRUNC flag for truncated UDP packets
Previously recvmsg() wasn't setting MSG_TRUNC flag as it does on other
systems, so it wasn't possible to detect when packet is bigger than the
buffer. Updated mxsio_recvmsg_dgram() to detect this case and set the
flag.

NET-170

Change-Id: I91c4a657b479c4bbb459dfc740c25c59a218f1a4
2017-09-11 18:57:43 +00:00
Carlos Pizano 7df8af9197 [kernel][object] job policy update for timers
To line up with all the other objects that don't require
a parent handle the policy can now deny new timers.

Change-Id: Iff69f2c6f97322a4d30661b43eef955a7d7db7c8
2017-09-11 16:26:52 +00:00
Mike Voydanoff d91d891fc5 [dev][cdc-eth-function] Introduce CDC ethernet USB function driver
This driver implements CDC ethernet for USB peripheral mode

Change-Id: Ie12421d0dc24249fe014881b41c37ecab286d6e1
2017-09-11 14:49:02 +00:00
Brian Swetland 4a588394f1 [loader-service] provide customization hooks
This allows users of the full-featured loader service to provide
their own implementations of object / interp / config loading and/or
sink publishing,

Change-Id: I371174bad56802a3012ec684a6cc8a61ea9805ec
2017-09-11 04:31:19 -07:00
Roland McGrath 25156ee929 [build] Don't use rodso.ld with lld
With lld's -z rodynamic, it's now possible to do the "rodso" cases (the
vDSO and userboot) without using the scripts/rodso.ld linker script.

Change-Id: I30cb10a23e71878f524f04f30c4834c108c90efd
2017-09-09 02:52:02 -07:00
Brian Swetland 3e23b10258 [mxio][launchpad] loader-service moves to launchpad
This is the logical place for it to live and paves the way to migrate
it away from the soon-to-be-no-more mxio dispatcher.

Tidied up the API, de-mxio'd it, put it behind a common loader_service_
prefix, and broke some swiss-army-knife interfaces into more standalone
pieces, hopefully easier to understand.

Change-Id: I91acd79a44c5dcc72412484bd6e151a54d52c8a1
2017-09-09 01:20:11 -07:00
Roland McGrath fcac280b01 [host][mkfs-msdosfs][netprotocol] _BSD_SOURCE -> _GNU_SOURCE
The _BSD_SOURCE feature-test macro is deprecated and newer
in glibc versions the headers generate a warning for using it.
_GNU_SOURCE enables everything that does and more, and our
code is compatible with it.

Change-Id: Ic049fd835d77f17e81faae0ac3349565a5b6f9b6
2017-09-09 07:12:40 +00:00
Jeff Brown 3d4b23762a [trace-example] Move to uapp since it's not really a test.
Change-Id: I47d038b55a8fb219e98d9490b92b5e01bfcc37e8
2017-09-09 03:39:40 +00:00
Brian Swetland 1381b36113 [userboot] migrate from print() to printl()
Change-Id: I8764ab08368b6bfa32f2df968bbd64389b81de6a
2017-09-09 02:39:59 +00:00
Brian Swetland f4ffdea785 [userboot] provide a mini-printf-to-log utility
Change-Id: Id7a5d80899b61dd59356c1051801fdda3262f4a6
2017-09-09 01:49:59 +00:00
Brian Swetland 1b5c38f23d [mxio][bootfs] mmap directory, provide bootfs_open() api
Change-Id: Ia2d3a896dc4455df8a22da7f50fcc02f1b8d3d7f
2017-09-08 17:48:48 -07:00
Brian Swetland 097c4f1a54 [mxio][dispatcher] remove no-longer-needed includes of dispatcher.h
Change-Id: I865f9c31b2a0758ce3c662384606497cf6da9276
2017-09-09 00:39:19 +00:00
Sean Klein 95e06a4fd4 [fs] VFS-related cleanups
- RemoteContainer, WatchContainer moved to their own headers.
  (Vnode be moved in a later patch).
- V_FLAG --> VFS_FLAG
- "vfs-XYZ.cpp" renamed to "XYZ.cpp" (headers too)
- WatcherBuffer (implementation detail) moved out of header.

MG-1117 #comment in-progress

Change-Id: I39471b142564d3d8bcf90a05949073d0fa1b32d3
2017-09-08 15:29:24 -07:00
Sean Klein f371780fa6 [fs] Completely remove including mxio/dispatcher
Move remoteio-related error codes to remoteio.h.

Change-Id: I2612131e9c19ee8d5f1f6a64e78b30555d51c98b
2017-09-08 15:18:11 -07:00
Sean Klein 5514c11d3c [fs] Remove unused VFS dispatcher
Change-Id: Iba3355ee37c3de9f60d437fccd7ae15902f85be6
2017-09-08 14:40:44 -07:00
Sean Klein 243cd2b567 [fs] Fix build breakage due to duplicated gn files
(This was the result of a bad rebase)

Change-Id: I9a8679cb2fb69e5796a6a0339f93a46a3b1b0868
2017-09-08 14:35:44 -07:00
Sean Klein 6d5d7f7c96 [fs] Remove unused Mxio dispatcher
Change-Id: I691502ad0bb1bfe16a907e81d73ba4b608da6730
2017-09-08 21:26:49 +00:00
Mike Voydanoff 953029eb9b [dev][usb][dwc3] First cut at DWC3 USB controller driver
Implements basic peripheral mode support for DWC3

Still to do for peripheral mode:
- USB 3 support
- Isochronous endpoint support
- Scatter/gather support
- OTG support for better connect/disconnect detection

and beyond peripheral mode:
- USB host support (we will layer the XHCI driver on top of this driver for host support)
- role switching between host and peripheral mode
- power management

Change-Id: I028f7af18f4434e17e1fe5fe36f0d1a83a409e55
2017-09-08 21:20:09 +00:00
Sean Klein d02a1325d3 [devmgr] Replace devmgr dispatcher with libasync
Change-Id: I91781a4e605792341b10eda09a77bb4fca377ffe
2017-09-08 21:02:39 +00:00
Sean Klein fe12c84dd7 [blobstore] Replace mxio dispatcher with libasync dispatcher
Change-Id: I5443c9977a409c5eb7133f0d613e947c05c58835
2017-09-08 20:39:39 +00:00
Sean Klein a12054ffc9 [fs][minfs] Replace the vfs-dispatcher with libasync
Change-Id: Icfc3566510ae0e5f29ac2f0615681c00c831ece9
2017-09-08 20:17:09 +00:00
George Kulakowski b8f10eeced [utest][port] Just port-test, it's cleaner
Change-Id: I824cb7e978a0b16aa43f620e7c70a2cde1f1ae78
2017-09-08 20:08:29 +00:00
Jeff Brown 56fa14eb52 [async] Add RAII helpers for waits and tasks.
This makes the API a bit more convenient to use.

Fixed an inconsistency in the handling of cancelation errors.
We were previously checking for MX_ERR_BAD_STATE which can't happen
during cancelation.

Fixed some minor formatting inconsistencies introduced by the
mxtl->fbl rename.

Added some clarification around thread-safety.

Change-Id: If273a42eea2b869d63c79e47782c28fade339c92
2017-09-08 11:14:57 -07:00
Mark Seaborn f9bf25111c [utest][x86] Add test to check that gs_base is preserved across context switches
This is in preparation for changing the kernel code that saves and
restores gs_base.

Change-Id: I26668f6239390b7d916e2ec1f0190b97e2205f9b
2017-09-08 17:34:03 +00:00
Mike Voydanoff c1f5c118c7 [dev][usb-bus] Switch to new DDK dprintf() logging calls
Change-Id: Ia8d967dcea84935467f9950f637963ff534de1d1
2017-09-08 17:10:54 +00:00
Mike Voydanoff bc6afa00b9 [dev][xhci] Switch to new DDK dprintf() logging calls
Change-Id: I629e2b486de24749fb217e63d4ca40cb39b14390
2017-09-08 07:19:38 -07:00
Brian Swetland d8431aec14 [bootfs] streamline the bootfs format
- provide common header and entry structs in bootdata.h
  along with documentation comments
- stop treating bootdata headers as part of bootfs
- introduce a simple header with magic and directory size
  (allows easy mmap'ing of just the directory)
- align bootdata directory entries on U32 boundaries
- adjust mxio and userboot to deal with the changes

Change-Id: I09f96088f939dd541a6b23d70fcd8606d1af4f28
2017-09-08 01:13:54 +00:00
Todd Eisenberger 3b808d8cfc [dprintf] Correct documentation of commandline args
Change-Id: I9d1d06e85668e6c9000f480150df8889510192b2
2017-09-07 22:17:14 +00:00
Tim Detwiler 1a10fa241c [hypervisor][virtio] Add Virtio 1.0 PCI support.
This implementation is sufficient to boot linux with block and balloon
devices, however Magenta guests currently fail to map PCI bars that
don't map MMIO space. For this reason we still default to using the
legacy interface for now.

Change-Id: I873f0bd2285ee1c999a90ec2819b3a512d128039
2017-09-07 22:11:14 +00:00
Jocelyn Dang 90f33bb15d [dev][usb-device] Add functions for claiming interfaces.
Removes special casing for usb-audio and usb-cdc-ecm.

Those drivers will instead call usb_claim_additional_interfaces,
indicating what additional interfaces they require.

usb_claim_additional_interfaces will request the list of
descriptors following the interface's existing descriptor list,
and then check whether to claim the interface.

Claiming an interface appends the descriptors to the descriptor list,
and removes any existing child device.

There can be a race condition between a device being created for a child
interface, and an interface claiming that same interface, so there is a
interface mutex and we track the current availability of an interface
via the interface_statuses array.

Change-Id: I3a9599f21c76b85e9a21f561eb259415bde97308
2017-09-07 22:02:20 +00:00
Mike Voydanoff 1d105a4c87 [ddk][usb] Various improvements to USB peripheral mode support
- Changes to support USB functions that have multiple interface descriptors
  (like USB audio and CDC ethernet)

- Support for enabling/disabling endpoints when alternate interfaces are selected

- Add support for USB functions allocating string descriptors

- Add API for stalling/unstalling endpoints

- Fixes for disconnect handling

- Use new DDK dprintf() in usb-device and ums-function drivers

Change-Id: Id88e8e3816c2dba5dde83d6dbee02c2cde774bff
2017-09-07 21:26:55 +00:00
Tim Kilbourn 77a265be6f [hid] Include report id if it was in the descriptor
The USB HID spec says that if any report ID is given in the report
descriptor, it should be used in every report. We were previously
assuming that it would only be included if more than one report ID was
specified.

Change-Id: I206340ff53579ef6aa6019b97362f2198326b55d
2017-09-07 21:14:11 +00:00
George Kulakowski 59e644b1dc [zircon][mxtl->fbl] Rename mxtl to fbl
Change-Id: Ie21b6498e1bfb0a7fa0315e40b9e5c3ee78646be
2017-09-07 13:57:27 -07:00
George Kulakowski 77a89c40ca [gn] gn format all BUILD.gn files
Change-Id: Ibf190b9304343df41219f4f40c1ee9eb54c83678
2017-09-07 20:07:13 +00:00
Mike Voydanoff a69c4fb9b9 [ddk] Fix DDK_LOG_LTRACE macro copy & paste error
Change-Id: I03e4c90ec4f27b423e74608361d9c2f5b0b8bba2
2017-09-07 01:23:33 -07:00
Andy Mutton 950ddb93b3 [hypervisor] Fix backspace on Linux.
Change-Id: I3c221eeed42a74232f6ed2ad9fc6467047e2222f
2017-09-07 04:52:51 +00:00
Andy Mutton e1a41a3aba [hypervisor] Use AutoLocks in UART.
Change-Id: Ide5e26009aa07c486bbb30558e2a9c8b048d0b78
2017-09-07 04:01:30 +00:00