OSDN Git Service

arm64: psci: account for Trusted OS instances
authorMark Rutland <mark.rutland@arm.com>
Wed, 22 Apr 2015 17:10:26 +0000 (18:10 +0100)
committerMark Rutland <mark.rutland@arm.com>
Wed, 27 May 2015 12:22:09 +0000 (13:22 +0100)
commitff3010e6fcdb5f7e6999c6026ab7fcf835d54c5a
treeded0ec7421a409356313f599f22aff5175886764
parenta06eed3e90c272675f2ef50f5bc5b3ec91652d77
arm64: psci: account for Trusted OS instances

Software resident in the secure world (a "Trusted OS") may cause CPU_OFF
calls for the CPU it is resident on to be denied. Such a denial would be
fatal for the kernel, and so we must detect when this can happen before
the point of no return.

This patch implements Trusted OS detection for PSCI 0.2+ systems, using
MIGRATE_INFO_TYPE and MIGRATE_INFO_UP_CPU. When a trusted OS is detected
as resident on a particular CPU, attempts to hot unplug that CPU will be
denied early, before they can prove fatal.

Trusted OS migration is not implemented by this patch. Implementation of
migratable UP trusted OSs seems unlikely, and the right policy for
migration is unclear (and will likely differ across implementations). As
such, it is likely that migration will require cooperation with Trusted
OS drivers.

PSCI implementations prior to 0.1 do not provide the facility to detect
the presence of a Trusted OS, nor the CPU any such OS is resident on, so
without additional information it is not possible to handle Trusted OSs
with PSCI 0.1.

Signed-off-by: Mark Rutland <mark.rutland@arm.com>
Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Hanjun Guo <hanjun.guo@linaro.org>
Cc: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Cc: Will Deacon <will.deacon@arm.com>
arch/arm64/kernel/psci.c