History log of /fuchsia/zircon/kernel/include/platform.h
Revision Date Author Comments
# 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


# 7d18a4e0 30-May-2018 David Stevens <stevensd@google.com>

[debuglog] Enable debuglog with the early gfx console

Change-Id: I05f713cf4ec9d21ecd252e9271e9f6dc9ee14fd2


# b334d76b 26-Apr-2018 Mike Voydanoff <voydanoff@google.com>

[kernel][devmgr] Add "dm reboot-recovery" command

Adds support for booting into recovery partition

Change-Id: I8e7c15a6b25a878b0e722f016070ba46a1099f9b


# d2f43eba 07-Apr-2018 Sean Klein <smklein@google.com>

[kernel] Use zx_ticks_t as ticks unit, rather than uint64

Change-Id: I189a45336a9c0544de6a93a50f83d9b088dec77e


# 2096a3b7 28-Mar-2018 Todd Eisenberger <teisenbe@google.com>

[kernel][uart] Add a cmdline for overriding bootdata settings

Passing kernel.serial=none will turn serial off.
Passing kernel.serial=legacy on x64 will use the legacy COM1 port.
Not passing kernel.serial will fallback to the bootdata settings.
If no bootdata serial setting is provided, the system on x64
currently defaults to the legacy port.

This also updates the run-zircon script to take a --no-serial
argument for disabling serial. If this option is not provided,
run-zircon will pass kernel.serial=legacy to the kernel.

ZX-1901 #comment Add the cmdline argument

Change-Id: Ied0b159ce0c6ba0542f2a5087c63013f8324e9bc


# 01411ea8 22-Dec-2017 Mike Voydanoff <voydanoff@google.com>

[kernel][devmgr] Add "reboot-bootloader" command

On platforms that support it, "dm reboot-bootloader" or
"k reboot-bootloader" can be used to reboot into the bootloader,
similar to "adb reboot bootloader" on Android.

ZX-1506 #comment
ZX-1507 #comment

Change-Id: I1773862bf72e0ffa38fec996c7114bad95adb69a


# 47884aba 17-Nov-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][ktrace][arm] use the raw tick counter for ktrace on arm

-Add current_ticks() call which uses the appropriate architectural
counter.
-Switch ktrace to using that.

ZX-1387 #comment

Change-Id: I10f1f50c7b464abb241bf719026fbdca046b1226


# 8c68731d 02-Nov-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][suspend] Define arch/platform suspend/resume hooks

These hooks give the arch and platform layers a chance to preserve state before
suspend to RAM and reinitialize after.

ZX-1184

Change-Id: I0fc1931497db7f413efe4781575e30de3dd1ece0


# 591d66cf 25-Sep-2017 George Kulakowski <kulakowski@google.com>

[kernel][time] Prefer zx_{time,duration}_t to lk_time_t

Change-Id: Ie219c61f2ba7fd073917a6738221e2dde969fc2d


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

[zx] Magenta -> Zircon

The Great Renaming is here!

Change-Id: I3229bdeb2a3d0e40fb4db6fec8ca7d971fbffb94


# 2c876f99 15-Aug-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][headers] flip remaining headers to #pragma once

Mostly older LK code that wasn't using it.

Change-Id: I57464f1621f8d5b06601a90cf1d6e4124916762d


# 6e77e9af 31-Jul-2017 Gurjant Kalsi <gkalsi@google.com>

[x86][pc] Implements mexec for Intel x86 PC

Change-Id: Id257568884e91056bbaab64d8d4650ddfd49ddda


# fac5630d 27-Jul-2017 Gurjant Kalsi <gkalsi@google.com>

[platform] Implements halt_secondaries and thread_migrate_cpu

Implements two new APIs in the kernel:

(1) platform_halt_secondary_cpus

Halt any CPU cores that are not designated as the boot cpu
as the platform sees fit.

This call is intended to bring the system back into the state
it was in when it booted in order to fascilitate mexec.
This patch implements this call for x86.

(2) thread_migrate_cpu

Pins the current thread on a target CPU and ensures that the
migration has succeded.

In addition, this patch refactors mexec to use the new APIs

Change-Id: Ic05b76dd117e50fdb08f98ce92ccec443c870004


# 5ae1cd6d 27-Jul-2017 Gurjant Kalsi <gkalsi@google.com>

[platform] Define boot cpu id to be 0

Change-Id: Iea5c070f10efeea5d1cf82bb41c5b7c3ef8a4d4a


# 7ec39093 02-Aug-2017 Brian Swetland <swetland@google.com>

[pc][crashlog] add platform_recover_crashlog() and nvram crashlog support

- platform_recover_crashlog() provides a way to obtain the crashlog
contents in situations where it will not be located and passed in
via the bootloader
- arm gets a do-nothing implementation
- pc gets an implementation that works with the nvram crashlog
bootdata item, and its platform_stow_crashlog() now favors the
nvram crashlog over the efi variable crashlog if both are
available
- pc: change chipset level reset to a hard reset from a full reset,
to avoid multi-second system-wide reset that could impact memory
integrity

Change-Id: I6b600249e6504f14269dc2fc0f87e6c765073854


# 000197a5 18-May-2017 Brian Swetland <swetland@google.com>

[kernel][gigaboot][devmgr] reliable last crashlog mechanism

Introduce platform_stow_crashlog(), a simple API for the panic
path to pass a textual log to the platform in hopes that it will
find its way to the system after a reboot.

For the PC platform, if there is an EFI System Table, attempt to
use EFI Runtime Services to stash this data in an EFI variable.

Gigaboot will read this EFI variable and pass the crashlog to
the booting system as BOOTDATA_LAST_CRASHLOG, erasing the contents
of the variable afterwards.

Devmgr will unpack BOOTDATA_LAST_CRASHLOG into /boot/log/last-panic.txt

Change-Id: I6cc7602a2e85156f8d3353166f4cbc22413a5ae1


# ab10aa63 25-Apr-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][time] Rename lk_bigtime_t and current_time_hires()

Now that millisecond time is gone from the kernel, reclaim the names
used for it.

lk_bigtime_t -> lk_time_t
current_time_hires() -> current_time()

Change-Id: I7db5de01171096c04a2b12d293e047e6a08a0aef


# 4c4f7aec 03-Apr-2017 Todd Eisenberger <teisenbe@google.com>

[kernel][time] Switch kernel to nanoseconds internally

A subsequent diff will rename lk_bigtime_t to lk_time_t and
current_time_hires() to current_time().

Change-Id: Ied15e687714f784e2180aac59c8e0813c83bfcd0


# e04aff93 02-Jan-2017 Abdulla Kamar <abdulla@google.com>

[kernel][syscalls] Add mx_ticks_per_second to return ticks per second.

Together with mx_ticks_get, this can be used to calculate the amount of time
elapsed between two calls to the high-precision timer.

MG-392 #done

Change-Id: Ie1660ce546f544043e562c265f4d10c7dc0301f6


# 797f7d43 18-Nov-2016 Brian Swetland <swetland@google.com>

[bluescreen] show panic onscreen after we crash

- provide platform_panic_start() to request that we
prepare to show a panic message.
- call it from panic() and from x86 fatal faults
- fix up the user to kernel display handoff to not
allocate during gfxconsole-rebind-on-panic (oops!)
- for now don't try to replay the debuglog as it is slow
and potentially dangerous if the log is being updated
when we crash

Change-Id: I6b70c2c7bb9bc158f36088d5b08b82e5aaeaf617


# a9bebf05 03-Oct-2016 Travis Geiselbrecht <travisg@google.com>

[kernel][time] move current_time_hires() to nanoseconds

Find all the cases where it's used (mostly for benchmarking) and
make sure it's in nanoseconds.

Switch the PC time calculations to use the fixed point multiplication
routines.

Change-Id: I06ef9d705dbef3f23e20bf25b7a8c7c8f37a72b4


# fa53b5b5 14-Sep-2016 Travis Geiselbrecht <travisg@google.com>

[kernel][x86] add an IPI vector for halting the other cpus

Hit it in platform_halt() on PC so we can stop the rest of the system.

Change-Id: I52ea88e01dbb6879318103573efacc0d047bfeca


# 9b7c44af 25-Aug-2016 John Grossman <johngro@google.com>

[system] Merge kernel compiler.h with global compiler.h

Change-Id: Ia9f35fdb5321c82a3f844510ca93aada81d2f8c9


# c299cc7c 24-Jun-2016 Brian Swetland <swetland@google.com>

[platform] make default platform_get_ramdisk() more robust.

Update documentation.

Change-Id: I6c6b36023b849aba2d1e641a7528aac3bba9d582


# 471994d1 23-Jun-2016 Brian Swetland <swetland@google.com>

[kernel][platform] API to get at the ramdisk image

If such a thing exists.

Change-Id: I65e6abadbedd58fe290b37b3d512b7c328086f03


# 53b9e1c8 15-Jun-2016 The Fuchsia Authors <authors@fuchsia.local>

[magenta] Initial commit