History log of /fuchsia/zircon/kernel/arch/arm64/mp.cpp
Revision Date Author Comments
# f493ee3b 29-Aug-2018 Nick Maniscalco <maniscalco@google.com>

[kernel][arm64] Don't leak secondary CPU bootstrap thread stacks

When creating stacks for arm64 secondary CPU bootstrap threads, store
them in the _init_thread array rather than leak them. This allows the
boostrap thread to free them when it exits.

Test: Ran "k thread_tests" on arm64/gcc, arm64/clang. Counted stack
vmo's and vmar's to verify no leaks.

ZX-2547 #comment arm64 secondary cpu bootstrap threads

Change-Id: I27ffbbb73be4c5c784c291dcf8570c9334760c60


# 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


# 35a1ba79 27-Feb-2018 David Stevens <stevensd@google.com>

[kernel][sched][x86] Use monitor/mwait when idle

When rescheduling idle cpus, use monitor/mwait instead of relying on
IPIs. This change adds some reschedule-specific arch hooks, instead of
relying on the arch IPI hooks.

The x86 percpu state includes a variable that tracks whether the cpu is
running the idle thread. The idle thread monitors and mwaits on that
variable. Then other threads can reschedule the idle cpu by clearing
the monitored variable.

ZX-1713
ZX-1293 #done

Change-Id: I5f7bf073e3e5b6e1e5fa4febc412f52f40773e2d


# e8cf9e2b 05-Jan-2018 Travis Geiselbrecht <travisg@google.com>

[kernel][arm64] clang format arm64 code

Change-Id: Id4b2123b16549c555db28bc878dde434f4dc5506


# 857b3a69 31-Oct-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][arm64] fix bug in MP_IPI_TARGET_ALL_BUT_LOCAL

Bad test in an if statement, move to a switch statement so the compiler
will catch stuff liek this in the future.

Change-Id: Iadc7264c100f67d73970f5279bee6c6644083078


# 0601e9df 30-Aug-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][mp] add new header with types and routines to deal with cpu numbers

Add a few more types and switch some apis to using those. No functional
change.

Change-Id: I67add1247cf36d9e6a55f15dd809ffe4bafe06fd


# 8e562ab9 25-Sep-2017 George Kulakowski <kulakowski@google.com>

[kernel][status][arch] Use zx_status_t throughout kernel/arch

Change-Id: I051aaaee84c6e7776b0054171f8d69320d812fcb


# 05df96df 18-Aug-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][mp] change the inter-processor-interrupt api to take a enum and mask

This removes the special casing of a few mask values to mean all-cpus or
all-but-local. Also means we can push the SMP_MAX_CPUS up to 32 before
switching to a different mask type.

Change-Id: I89276c2d0acf77ae2df132beb9ef1dcd5ef3b7e9


# 13440c40 13-Jun-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][arm64] Create a per cpu structure and use the x18 register to point to it

At the moment use it to store the oft-used current cpu number and
is-in-interrupt flag.

Change-Id: I3203358ca47a3b193ef7cb01356b67b50c74ff0f


# 80a5b04c 30-Jun-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][arm64] when building the cpu map remember the cpu number within a cluster

Typo in the cpu map setup.

Change-Id: I3bf940b936aeab8cfed93688c3f4513ddeec9cf8


# e64f1122 24-Apr-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][arm64] convert C code to cpp

First pass simple conversion from C to cpp

Change-Id: I17772141e829d137a52281c331515afa8fa12516


# 116ed79a 24-Apr-2017 Travis Geiselbrecht <travisg@google.com>

[kernel][arm64] mass rename arm64 files from .c to .cpp

No attempt to make them compile

Change-Id: If9eef1aded99e20b3046a387cdb29ef1dbe2e587