History log of /fuchsia/zircon/kernel/syscalls/system.cpp
Revision Date Author Comments
# 8fcba2f4 25-Sep-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][pmm] convert pmm_alloc_contiguous to returning status instead of page count

Tested: runtests on both x86 and arm

Change-Id: Ib8cddb85a676115bace55d992f82518024e3a193


# 46a7c5a8 24-Jul-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][pmm] change pmm single page alloc routines to return status

Move from returning a status and the page pointer and/or physical
address in an argument.

Tested: build and runtests on both x86 and arm

Change-Id: If10d877f152d355bfa1359338cd71f5aefbccfb4


# 321cb5ae 08-Sep-2018 Roland McGrath <mcgrathr@google.com>

[kernel] Remove #if WITH_LIB_* conditionals

There's only one configuration of the kernel per architecture, so these
are always defined anyway. The global predefines based on what modules
are in the dependency graph is not a feature future build systems will
support.

Test: CQ & manual verification that kernel text size didn't change
Change-Id: Ib4c9b6c309c9ae4fc410701eef8fbdfad4d90641


# a09408b5 14-Aug-2018 Nick Maniscalco <maniscalco@google.com>

[debuglog] Shutdown debuglog before shutting down system

Prior to this change, we'd sometimes miss the last several log
messages emitted shortly before shutdown. This was a problem for CQ/CI
tests. See INTK-281 for details.

Add function to shutdown the debuglog subsystem and join its
threads (dlog_shutdown).

Call dlog_shutdown as part of graceful shutdown path.

Change core-tests to print magic "success" string only once.

Test: Tested manually as follows:
- Ran on CQ, observed that core-tests now show full output.
- Inserted a panic after dlog_shutdown, verified panic is printed.

ZX-2489 #done

INTK-281 #comment dlog_shutdown

Change-Id: I99f6a61b6afcf6387c4ab28f70db8f33e13a308a


# 7d81deec 19-Apr-2018 Christopher Anderson <cja@google.com>

[kernel][rsrc] Change ResourceDispatcher model

In general, this change moves resources to a model of
"resource allocation" and "resource validation" as separate
but related concepts. On resource creation, an allocation
against physical address space is made. On resource validation,
a syscall checks that the resource provided has the correct
allocation to permit the call asked. This means that the ROOT
resource /can/ allocate resources, but does not have to if it
simply wants to pass syscall validation. This is important
so that the ROOT resource can create specific resources that
are then passed out to drivers and used to validate access
to their hardware resources.

- Change low/high to base/length and change logic to match.
- Wire in usage of PhysicalAspaceManager so MMIO/IOPORT/IRQ
resources try to allocate from the global address space.
- Change resource access so that only the root resource can
create sub-resources.
- Track ResourceDispatchers created across the system.
- Define ZX_RSRC_KIND_ROOT as a privileged resource that will
pass all validation so that platform bus implementations
like ACPI can behave as they may.
- Initialize the allocators after the heap is initialized.
- Reserve regions marked as memory by the bootloader for x86.
- Reserve regions marked as memory in the zbi structures for ARM.
- zx_vmo_create_physical calls validate_resource_mmio
- zx_ioports_request calls validate_resource_ioports
- zx_interrupt_create calls validate_resource_irq

Test: For kernel tests, 'k ut resources'.
Syscall tests are run as part of core-tests.

ZX-971 #done

Change-Id: Iac6c4aa9e95718a0a0768ef8e3036353e73de8dd


# 55c2bb42 06-Jul-2018 Todd Eisenberger <teisenbe@google.com>

[kernel][mexec] Fix hangs during mexec

We were seeing hangs in mexec due to
1) Forcefully stopping the other cores which may have been holding
locks, and
2) Acquiring mutexes after we've disabled interrupts, potentially
leading to unexpected behavior

ZX-2339 #done
ZX-2344 #done

Test: Ran a lot of mexec cycles, didn't see anymore hangs

Change-Id: I5b7cf565cebe2a95a34b1a5694880f56528f7a97


# 896f6d8a 08-Jun-2018 Nick Maniscalco <maniscalco@google.com>

[kernel] Gracefully stop secondary CPUs when shutting down

Prior to this change...

... on x64, ZX_SYSTEM_POWERCTL_SHUTDOWN would aggressively shutdown
secondary CPUs without giving them a chance to complete critical
sections and release spinlocks. This led to hangs during shutdown (see
INTK-390).

... on arm64, the shutdown of secondary CPUs was more controlled as
they were first parked by having each CPU halt itself. However,
runqueues, DPCs, and timers were not properly handled. For example, a
DPC could fire after its CPU has been offlined, resulting in an
assertion failure (ZX-2232).

This change:

- Updates x64 and arm64 to more gracefully shutdown secondary CPUs
- Unifies the graceful shutdown paths for arm64 and x64.
- Implements arch_mp_cpu_unplug, arch_mp_prep_cpu_unplug, and
arch_flush_state_and_halt on arm64
- Changes arm64 to use mp_unplug_cpu_mask_single_locked
- Removes a workaround from userboot/start.c (INTK-390)
- Renames platform_halt_helper to platform_graceful_halt
- Removes unused enum values from platform_halt_reason
- Updates comments for platform_halt and platform_halt_secondary_cpus

Tested: Manually, observed no hangs, no panics. Details below...

- Boot looped 300,000 times ('userboot=bin/ps userboot.shutdown=true')
- qemu/arm64/gicv2
- qemu/arm64/gicv3
- qemu/x64
- Flashed vim2, netbooted, ran 'dm reboot' a few times
- Flashed eve, netbooted, ran 'dm reboot' a few times

ZX-2232 #done

ZX-2228 #comment progress

Change-Id: Ib667b272f516dc2e663aa393c1ec78837535041f


# dac02256 11-Jul-2018 Abdulla Kamar <abdulla@google.com>

[ulib][zbi] Rename zbi to libzbi

This is to avoid the naming collision with the zbi tool, so that the
ulib can be exported for use by upper layers.

Test: Built Zircon and Garnet, then ran using "fx run -k".
Change-Id: Ib3f495f908791f6808fa4a399d087f24ec501a88


# d5e04b95 09-Jun-2018 Adam Barth <abarth@chromium.org>

[mexec] Guard mexec behind the root resource

Userspace processes should not be able to replace the kernel without a
capability.

Change-Id: I20da78d7dbafa171e0b0795347618b77fd0bda96


# 732196ca 05-Jun-2018 Gurjant Kalsi <gkalsi@google.com>

[libzbi] Reapply libzbi append bootdata change

This change was previously reverted due to a bug which
has since been fixed.

Change-Id: I9237fe9ae999b03c394120bbab29537e72da9108


# da7b0d57 05-Jun-2018 Gurjant Kalsi <gkalsi@google.com>

[libzbi] Revert zbi append section change

Unbreaks paver boot loop that some folks are experiencing

This reverts commit da1e998d28d776b3706589af28c6a900081f7f7d.

Change-Id: Ibcc856dc0feba31aae5811ce4ee03f035081912d


# da1e998d 01-Jun-2018 Gurjant Kalsi <gkalsi@google.com>

[libzbi] migrate bootdata_append_section to libzbi

libzbi implements Zbi::CreateSection and Zbi::AppendSection
which duplicate the functionality of bootdata_append_section.

bootdata_append_section had several problems:
+ It was implemented in syscalls/system.cpp which isn't
really an appropriate place for that utility function.
+ It was only available in the kernel so there was no
way to share that code in userspace, libzbi is shared
with userspace.
+ Tests for bootdata_append_section lived in the
syscalls/... folder which isn't really an appropriate
place for those tests.

Change-Id: I4c9c9481919b8c57b74e5d944520687ca4a03733


# e0eb15db 01-Jun-2018 Gurjant Kalsi <gkalsi@google.com>

[libzbi] Implement zbi_create_section.

Divides zbi_append_section into two seperate
methods:

zbi_create_section creates an empty section at
the end of the ZBI and passes a pointer to the
payload back to the client.

zbi_append_section maintains its current
functionality.

Change-Id: I14a887eb874c3d9dce45cf68e24c8ecf2f21c79a


# a8a6d268 31-May-2018 Gurjant Kalsi <gkalsi@google.com>

[zbi][kernel] Remove all references to bootdata

Convert the kernel from bootdata to zbi with a few
notable exceptions:
+ Process bootdata on x86/PC was not converted
because we intend to migrate that to using
libzbi in a future patch.
+ syscalls_system.cpp/mexec weren't migrated for
the same reason as above.

bootdata_unittest.cpp was also removed because it
tests the bootdata append functionality which is
redundant with libzbi functionality and slated
to be removed.

Tested by booting on the following platforms:
+ QEMU ARM
+ QEMU x86 (KVM)
+ Vim2
+ UEFI based x86 system

Change-Id: Ifcf803b16a20a70ecd2f4aae930b0304e9cb3437


# 50dc7eb8 31-May-2018 Brijen Raval <braval@google.com>

[devmgr][syscalls] Add shutdown/reboot support in zx_sys_powerctl

Modify the devmgr-coordinator to use zx_sys_powerctl()
instead of zx_debug_send_command() syscall

ZX-2182 #done
Change-Id: I0b7271956530d0dde91d7cef26a32b2d9c8ff01c


# fef7e995 10-Apr-2018 Roland McGrath <mcgrathr@google.com>

[kernel][mexec] Replace magic address with calculation

The hard-coded magic number was correct (at least currently on x86)
but it was not at all clear why. Use a calculation that makes it
clear where this number comes from.

Change-Id: I68475865b046950663756e4d2c58336fba0e398d


# e5d429fb 28-Mar-2018 Shai Barack <shayba@google.com>

[syscall][vmo] removal of zx_vmo_{read,write}() actual parameter 16/n

Plumb removal of actual further down.
Still need to plumb into sys_process_{read,write}_memory

ZX-1802

Change-Id: Ibba8ce14815f34a9ca08abf854996418a25d1a87


# ae9fad2c 15-Feb-2018 Nick Kralevich <nnk@google.com>

[kernel] spelling fix in comment

Change-Id: I67b708d407d66b93c5f0aa9574c61e9e7b83bc11


# db3f0191 22-Dec-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][syscalls] Remove redundant filename prefix

All of these files are already in a directory named syscalls.

Change-Id: If4945b107c2ae9787e63dfbfe3750d7dfdba739b