7227 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
Abdulla Kamar 627e15ffbf [arm64][hypervisor] Add El2CpuState.
Add code to manage EL2 CPU state. Currently this does the very minimum
and sets the EL2 stack for each CPU.

Next, I'll start setting up more of the EL2 state and also guest
physical address space.

Change-Id: I18b7f9d00b236e52cdc317dffe3b42fcffbcb8fe
2017-09-12 08:22:07 +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 ff83aeec1c [linenoise] allow get columns query to timeout
Change-Id: Ifa92588c564205818eef7b24b356d440254eca64
2017-09-12 06:04:42 +00:00
Gurjant Kalsi 6c6d9ae7f1 [arm] Implements platform_halt_cpu for generic ARM
Change-Id: I922336ce94437e47fe333c7ad15241e6949b105c
2017-09-12 01:48:27 +00:00
Abdulla Kamar 32358447a4 [x86][hypervisor] Minor naming cleanup.
This is just to mirror naming in El2CpuState.

Change-Id: I904d56da2f5f4a348bf8634000a23ebd98d3af04
2017-09-12 01:32:07 +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 685a2f5e3b [musl][dl] provide dl_clone_loader_service()
If there is an active loader service and it supports obtaining
a new connection, this function will return a new connection.

Change-Id: I58fe4d2450dc656340ed352424ef095ad19227fe
2017-09-12 01:08:01 +00:00
George Kulakowski fe3e7a2700 [kernel][glue] Use the handle arena's built-in count
Change-Id: I641fbe2e4b3dfd12a09f6e17712946efbd1b66e4
2017-09-12 00:51:21 +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
Abdulla Kamar 028c7e3ea6 [arm64] Prefix EL1 exception functions with "el1".
This is to disambiguate them from the EL2 exception functions that
will be used with the hypervisor.

Change-Id: Ia679397f31fc0410ef3f267a759ff80d44ab18b9
2017-09-12 10:05:24 +10:00
Abdulla Kamar 776d4eed1b [hypervisor] Extract common CPU state logic from VmxCpuState.
This is so we can reuse some of this logic in El2CpuState, and
customise it for allocating VMIDs.

Change-Id: I05b76d9694b8ed4446763604239cb78f77786e7f
2017-09-11 23:45:01 +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
Todd Eisenberger b0a8a698ed [x86] Add serializing instruction to arch_sync_cache_range
This is in line with Intel's recommendations for self-modifying code.
It will ensure visibility of changes to the instruction stream.

Change-Id: I5bbc1ab66319d3df5303d890483604c930e5cc1b
2017-09-11 20:55:58 +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
Andrew Krieger e45bdf6546 [docs][entropy] Document entropy quality tests
Change-Id: I9ac2cf8567a739e03918f3d0a27f574069b2f70d
2017-09-11 11:26:29 -07:00
Andrew Krieger 09ce41899a [entropy] Enable jitterentropy as entropy source
Testing shows that, with the newly set parameters (bs=64, bc=512, ml=32,
ll=1, raw=true), each byte of data contributes approximately 0.58 bits
of min-entropy on the rpi3 and 0.5 bits on qemu-arm64.  A safety factor
of 0.9 gives us 0.50 * 0.9 * 1000 == 450 bits of entropy per 1000 bytes
of random data.

This adds about 40ms to boot on rpi3 and 30ms on qemu-arm64.
Jitterentropy doesn't work on x86 as of this commit (the timer isn't
ready during early boot), so there should be negligible slowdown on x86.

On rpi3, about 10ms is due to the actual entropy draw from
jitterentropy, and 30ms is due to the startup testing built into
jitterentropy. Once we have entropy source testing in the kernel, we can
replace the jitterentropy testing time to reduce blocking during the
single-threaded, pre-VMM boot phase.

Change-Id: Ibf258412c7947e4e828926a88c0897f22199d7d3
2017-09-11 10:05:15 -07: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
Roland McGrath 4cb8b1210c [prebuilt] Update Clang toolchain
This is a re-land of the same toolchain as the last attempt.
New warnings it generates have been fixed in the code.

Change-Id: I60b7fe0f4e0118247bbc6d4eb4fa7a57e5d5cac0
2017-09-09 02:51:57 -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
Abdulla Kamar 20d00ea004 [arm64] Enable .cfi_return_column for clang.
It looks like the upstream fix has been integrated into our prebuilt
toolchain, so we can use .cfi_return_column for clang.

Change-Id: I8abeda64e514b1be0be7a4a2e610ddef38692124
2017-09-09 06:56:09 +00:00
Petr Hosek c67a9eb4d0 [libc] Use atomic_load to read FILE->lock
FILE->lock is atomic_int and so should be read using atomic_load.
Previously this wasn't reported, but with a new Clang this is
triggering an error because of -Wtautological-unsigned-zero-compare.

Change-Id: I3fe11f4be356a96d688e90614a9498d3c9eba05e
2017-09-09 03:53:29 +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
Petr Hosek 2273afa447 Revert "[prebuilt] Update Clang toolchain"
This reverts commit a8a283aced.

Reason for revert: musl build is broken with the new toolchain.

Original change's description:
> [prebuilt] Update Clang toolchain
> 
> Change-Id: Id5b7e9e2ae77b2b0058e03b52b2ace2f3d790d7c

TBR=phosek@google.com,mcgrathr@google.com

Change-Id: If76fab85e20da7a5a07161b2672d277791208e85
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
2017-09-09 02:12:50 +00:00
Brian Swetland f4ffdea785 [userboot] provide a mini-printf-to-log utility
Change-Id: Id7a5d80899b61dd59356c1051801fdda3262f4a6
2017-09-09 01:49:59 +00:00
Petr Hosek a8a283aced [prebuilt] Update Clang toolchain
Change-Id: Id5b7e9e2ae77b2b0058e03b52b2ace2f3d790d7c
2017-09-09 01:38:01 +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
Todd Eisenberger 8096b343bd [docs] Provide example use of current mx_cprng_draw API
Change-Id: I56bec1509a60ae5302d6444ba36ad616fca2ce99
2017-09-09 00:16:32 +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