OSDN Git Service

KVM: arm64: Enforce reserved bits for PSCI target affinities
authorOliver Upton <oupton@google.com>
Wed, 18 Aug 2021 20:21:32 +0000 (20:21 +0000)
committerMarc Zyngier <maz@kernel.org>
Thu, 19 Aug 2021 08:08:57 +0000 (09:08 +0100)
commite10ecb4d6c0761ca545b3946df1707a41f9f845e
tree62d7304a52743a1e606b1ba475f8595bd47b36fe
parent6826c6849b46aaa91300201213701eb861af4ba0
KVM: arm64: Enforce reserved bits for PSCI target affinities

According to the PSCI specification, ARM DEN 0022D, 5.1.4 "CPU_ON", the
CPU_ON function takes a target_cpu argument that is bit-compatible with
the affinity fields in MPIDR_EL1. All other bits in the argument are
RES0. Note that the same constraints apply to the target_affinity
argument for the AFFINITY_INFO call.

Enforce the spec by returning INVALID_PARAMS if a guest incorrectly sets
a RES0 bit.

Signed-off-by: Oliver Upton <oupton@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20210818202133.1106786-4-oupton@google.com
arch/arm64/kvm/psci.c