History log of /fuchsia/zircon/kernel/object/process_dispatcher.cpp
Revision Date Author Comments
# 9a8a6aad 13-Sep-2018 Ankur Mittal <anmittal@google.com>

[debugger] Add debugger exception to jobs.

ZX-2207 #done

TEST=exception_tests

Change-Id: I305d3bf9088dff7f0b6f6c9e824d5ecb8f2c3e36


# 36320886 19-Jul-2018 Corey Tabaka <eieio@google.com>

[kernel] Dispatchers and most kernel objects lockdep instrumented.

- Convert SoloDispatcher to a CRTP template type similar to
PeerDispatcher. This makes the lock classes for different solo
dispatchers distinct.
- Instrument the locks for all dispatchers.
- Instrument the locks for all kernel objects except those that
lock the thread_lock.

Bug: ZX-23
Test: k ut all and system/test/* pass + manual stress testing.

Change-Id: I8106c04911e47ea15ccce8e7abd5fbd62adfa6fe


# f1e6cbdd 08-Aug-2018 Doug Evans <dje@google.com>

[exceptions] Return ZX_ERR_ALREADY_BOUND for already bound port

ZX-2473 #done

Tested: runtests

Change-Id: I7395b9d85a99136624ac26701efe95ed404e3ffa


# c60c64df 05-Aug-2018 Abdulla Kamar <abdulla@google.com>

[hypervisor] Make zx_guest_create return a VMAR

Modify zx_guest_create to return a VMAR that represents the guest
physical address space.

A follow up CL will cover changes to the MMU code that allows uncached
and write-combining VMOs to be mapped into the guest physical address
space VMAR.

Test: Ran 'vmar-test', 'hypervisor-test', 'machina_unittests',
and 'guest launch zircon_guest'
Change-Id: I4b9eada3ccb206a205c6b30f1cf882766ba70fed


# f259a953 18-Jul-2018 George Kulakowski <kulakowski@google.com>

[process] Remove unused UndoRemoveHandleLocked

Now that syscalls generally consume handle arguments (even on
failure), this is unused.

Test: no functional change, dead code removal

Change-Id: I6152b10628e081a82d2efed91c00073451d42100


# 6b9e9598 09-Jul-2018 Brett Wilson <brettw@google.com>

[loader] Allow break on loader initialization.

The loader sets the process property ZX_PROP_PROCESS_DEBUG_ADDR, when it
initializes. This can be used for debuggers to get the list of loaded
libraries and to set breakpoints on library loads.

But since this is set programatically by the process code itself, the
debugger has no way to know when the query this property. If it does not
get queried before user code runs, symbolic breakpoints will not work.

This patch adds a constant that the debugger can set this property to
before execution starts. The loader checks for this and if set, issues a
manual debug breakpoint after the value is set.

A debugger can then catch this breakpoint, complete setup with the
correct debug address, and continue program execution.

TEST=manual

Change-Id: I63fc824531d1f7b09029ea01be5a93e1e9abddbb


# 21f42445 02-Jul-2018 Carlos Pizano <cpu@google.com>

[zircon] Exempt ZX_INFO_HANDLE_VALID from policy

.. from policy check. In other words the syscall
zx_object_get_info(handle, ZX_INFO_HANDLE_VALID, nullptr, 0..)
should not generate an exception even if the job policy has
ZX_POL_BAD_HANDLE enforced.

The intention here is to allow developers to write debugging
aids that don't cause a fatal crash, without having to tweak
the job policy.

This was so at some point but lacking a test it regressed.

TEST= handle-info-test
policy-test (new test)

Change-Id: I9ec0f93c3fe5cd998b11adffdbf2fc2e1054c248


# 1cc21336 25-Jun-2018 George Kulakowski <kulakowski@google.com>

[handles] Tweak zx_handle_close_many's behavior on ZX_HANDLE_INVALID

Also tweaks the tests and adds comments. In particular, make it clear
that iteration over duplicate handles still succeeds in closing all
handles.

Test: modified handle-close test

Change-Id: If89046260473d5f45a768388665f859e7ae9c8fb


# a31ed558 21-Jun-2018 George Kulakowski <kulakowski@google.com>

[handles] Introduce zx_handle_close_many

Test: handle-close-test tests success and failure cases.

Change-Id: I85bd0fc52aad474e826a4ec8c6e3ee7f94f039b0


# 77aa68ae 06-Jun-2018 George Kulakowski <kulakowski@google.com>

[process] Use the common dispatcher lock

Change-Id: I762f64f452ad8e8ed8d17b2cf313ac4b748fe7ea


# f50bd8d0 22-May-2018 Carlos Pizano <cpu@google.com>

[zircon][clean-api] process return code

To have explicit size, in this case int64_t

Change-Id: I9d5bc3d5564787bd5a6146ae952126f6f856db7b


# 4a03fdde 08-May-2018 Nick Maniscalco <maniscalco@google.com>

[kernel] Fix race when creating ProcessDispatcher

Even though JobDispatcher does not hold RefPtrs to its
ProcessDispatchers, the ProcessDispatchers must already be adopted
because JobDispatcher will "upgrade" its raw pointers when enumerating
processes. See ZX-2105 for more detail.

Ensure that all objects passed to AddChildProcess and AddChildJob have
already been adopted.

ZX-2105 #done

Change-Id: I32ad772458f6bcaee345b453377105bfed460709


# a0672e5d 02-May-2018 Roland McGrath <mcgrathr@google.com>

[public][ulib][dev] Add __FALLTHROUGH macro for warning suppression

GCC 7 enables -Wimplicit-fallthrough with -Wextra, so we'll get it.
Clang has it available, so start using it and clean up code accordingly.

The GCC feature will actually recognize some formulaic comments to
suppress the warning. But there's also an explicit syntax, and
C++17 added a standard one. So use that instead, via the new macro
__FALLTHROUGH in <zircon/compiler.h>.

TC-36 #comment Clean up code in preparation for more -Wimplicit-fallthrough

Change-Id: I28309c91c32db1313d52f4255836c5ea687e141f


# 267550b4 06-Feb-2018 George Kulakowski <kulakowski@google.com>

[abigen] Rename sysgen to abigen, per our grand aspirations

ZX-691

Change-Id: I53a2cacaf08259ead4035e0b9555fd80dde82d90


# 58436952 30-Jan-2018 Carlos Pizano <cpu@google.com>

[zircon] Fix process leak

If the process handles are closed and has not transitioned from
the INITIAL state the teardown was never executed therefore
leaking the process, mostly because it was never removed from
the parent job.

See bug for testing procedure.

ZX-1611 #done

Change-Id: I7924c48e27a4d46dee7540a3444bb548a1869e41


# 08b0ec8a 10-Jan-2018 Doug Evans <dje@google.com>

[kernel][exceptions] Fix panic from process freeing own eport

The failing sequence is:
- process holds last handle of exception port and port is bound to it
- process exits
- transition to DEAD state grabs state_lock_
- closing of handles calls ExceptionPort::OnPortZeroHandles
- ExceptionPort::OnPortZeroHandles calls
ProcessDispatcher::ResetExceptionPort
- ProcessDispatcher::ResetExceptionPort tries to regrab state_lock_

Fix by moving the code to handle the transition to State::DEAD into
one method (there was already some code outside of SetStateLocked
to do stuff outside of state_lock_, namely call job_->RemoveChildProcess).
This allows on_zero_handles to be processed outside of state_lock_.

zx-1544 #done

Change-Id: I985095c2896645de072e24e0e3aacbd1e3332d21


# 2cce3bc2 03-Dec-2017 Carlos Pizano <cpu@chromium.org>

[zircon][object] unroll kobj deletes

Introduces a mechanism for unrolling the recursion that can
happen when refptrs to certain dispatchers are reset. This
can cause a recursive delete that is solved with one TLS
slot and the machinery of fbl_recycle()

This allows removal of the handle reaper machinery which
could clog the dpc threads, which now only do time critical
things.

Change-Id: I68fac0aa470fd2553a7b50c84f49e9827c26f634


# 1077907f 08-Dec-2017 Carlos Pizano <cpu@google.com>

[zircon][process] don't kill process on handle

.. on handle close

This is the second step, started here
https://fuchsia-review.googlesource.com/c/zircon/+/95340

With the in-depth info in ZX-820 and in ZX-1106

So up to this point closing the last handle to
a process killed the process. With this change this is
no longer true. Processes still can be killed via the
job and the job semantics have not changed and
will not change; closing the last handle to a job
does tear down the job tree.

Change-Id: Ieb86899a95fc4dcd715b4c3c954c61db6f7ec6d6


# 3a828bef 06-Dec-2017 Roland McGrath <mcgrathr@google.com>

[kernel][object] Clean up Handle implementation

This moves everything into the Handle class. The code that was in
global functions before is now in class and instance methods, and
there's miscellaneous refactoring to make the code tighter.

Almost all the public API functions now use the HandleOwner smart
pointer type rather than raw Handle* pointers.

The <object/handle_owner.h> header is gone and now HandleOwner is
defined directly in <object/handle.h>, which simplifies things.

Change-Id: I578c948c347e1ffa74c3a254738387303610da79


# 75cd3680 05-Dec-2017 Roland McGrath <mcgrathr@google.com>

Clean up sloppy zx_handle_t/integer conflation

Change-Id: I5659232efa8531ef97261639cc65f211ee9f0cc8


# 9d2eeade 15-Oct-2017 Doug Evans <dje@google.com>

[kernel][exceptions] Send gone,suspended,resumed exceptions as signals

This is derived from CL 56613.
This also pulls in the debugger and exception tests from CLs 76025, 76026.

This patch reapplies 7e259986ff197b88212f9256a4859c8650feddfb.

ZX-814 #comment patch

Change-Id: Ida347bfed6644e2f33e86c0d6e26aee0c0f9c1a0


# b7fce3a5 02-Nov-2017 Doug Evans <dje@google.com>

Revert "[kernel][exceptions] Send gone,suspended,resumed exceptions as signals"

This reverts commit 7e259986ff197b88212f9256a4859c8650feddfb.

Garnet needs updating for deletion of ZX_EXCP_GONE

Change-Id: I2ecd3798df30fd64abbbebc6ade21e73473374ab


# 7e259986 15-Oct-2017 Doug Evans <dje@google.com>

[kernel][exceptions] Send gone,suspended,resumed exceptions as signals

This is derived from CL 56613.
This also pulls in the debugger and exception tests from CLs 76025, 76026.

ZX-814 #done

Change-Id: I9f5ac57079e90473092e88e84862461a295b1bfa


# 709f0e57 04-Oct-2017 George Kulakowski <kulakowski@google.com>

[user_ptr] Enforce IN/OUT/INOUT semantics

Change-Id: I54e92ed999c1965114aa80aeffe8d0fc16184b40


# 68239a18 10-Oct-2017 Doug Evans <dje@google.com>

[kernel][exceptions] Remove exception_lock_

... from ThreadDispatcher, ProcessDispatcher and just use state_lock_.
[to be eventually supplanted with lock_]

Change-Id: Ice481fc4321fd2822cc035ab67a707e3d8d5979b


# d363aa54 04-Oct-2017 George Kulakowski <kulakowski@google.com>

[dispatcher][state_tracker] Move the state tracker into the dispatcher

Note that all access to the old StateTracker functionality is still
mediated by the has_state_tracker function. This is used to e.g. allow
only certain objects to be user signalled.

Change-Id: If9d0413eb131c6e7d70ea19c1ed928f7bf566cc8


# cac62e0a 29-Sep-2017 Dave Bort <dbort@google.com>

[kobject] Better state guards on some ProcessDispatcher methods

This would've helped debug the crash in ZX-1166, where a call to
ProcessDispatcher::PageCount() dereferenced a bad pointer during
JobDispatcher::EnumerateChildren(), called by DumpProcessMemoryUsage()
during an out-of-memory event.

While I'm at it, move the method implementations out of diagnostics.cpp;
they no longer need access to static helpers in that file.

Change-Id: Iba6d5fd63ed9d39d72229e89c267e113a88c8cbd


# 5fb8e9ed 23-Sep-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][vm] move vm.h to the new spot and remove some unused code

Change-Id: I69f1b804fb95dd44e3e0619943e8809519aa82ca


# e0fbf267 12-Sep-2017 George Kulakowski <kulakowski@google.com>

[zx] Rename bug references from MG-nnn to ZX-nnn

Change-Id: I07b0ee32bd7e8cc08e344896352c156b3b420349


# f3e2126c 12-Sep-2017 Roland McGrath <mcgrathr@google.com>

[zx] Magenta -> Zircon

The Great Renaming is here!

Change-Id: I3229bdeb2a3d0e40fb4db6fec8ca7d971fbffb94


# 55921bc1 07-Sep-2017 Mark Seaborn <mseaborn@google.com>

[cleanup] Fix typo: "underling" -> "underlying"

Change-Id: I393d2ff3c898cacbd0f5a0acc9bf4d8f9f9ac91c


# 59e644b1 07-Sep-2017 George Kulakowski <kulakowski@google.com>

[zircon][mxtl->fbl] Rename mxtl to fbl

Change-Id: Ie21b6498e1bfb0a7fa0315e40b9e5c3ee78646be


# f70a42dd 05-Sep-2017 Dave Bort <dbort@google.com>

[libobject] Handle::HasRights replaces magenta_rights_check

Change-Id: If6010c9ca1921d2b47055a74f21d21e9038fe6c9


# ea31f442 01-Sep-2017 Dave Bort <dbort@google.com>

[libobject] Split magenta.h handle fns into handles.h

Change-Id: Ic1ad6964128d34c206df3f3f325ed6c115ec5e0e


# e1490736 01-Sep-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][vm] move kernel/kernel/vm to just kernel/vm

Change-Id: I8f724a9f8a61415712661d1fdd3dc4e1c70cf620


# 8779b382 01-Sep-2017 Dave Bort <dbort@google.com>

[user_copy] Remove lib/user_copy.h and object/user_copy.h

Make everyone use user_ptr or arch_copy_{to/from}_user.

Change-Id: I599463711fcd28f96638bae8dc6e59c106a11fd4


# 388a7f68 31-Aug-2017 Dave Bort <dbort@google.com>

[lib/magenta] Rename kernel/lib/magenta to kernel/object

TODO: Rename magenta.{cpp,h} and other instances of "magenta" in this
module.

For MG-1091 "Rename kernel/lib/magenta"

Change-Id: I2abc316f543798e00d3a4d1c2c83195da26e6836