Add a handler of PSCI SMCs in nVHE hyp code. The handler is initialized with the version used by the host's PSCI driver and the function IDs it was configured with. If the SMC function ID matches one of the configured PSCI calls (for v0.1) or falls into the PSCI function ID range (for v0.2+), the SMC is handled by the PSCI handler. For now, all SMCs return PSCI_RET_NOT_SUPPORTED. Signed-off-by: David Brazdil <dbrazdil@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20201202184122.26046-17-dbrazdil@google.com
19 lines
450 B
C
19 lines
450 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Trap handler helpers.
|
|
*
|
|
* Copyright (C) 2020 - Google LLC
|
|
* Author: Marc Zyngier <maz@kernel.org>
|
|
*/
|
|
|
|
#ifndef __ARM64_KVM_NVHE_TRAP_HANDLER_H__
|
|
#define __ARM64_KVM_NVHE_TRAP_HANDLER_H__
|
|
|
|
#include <asm/kvm_host.h>
|
|
|
|
#define cpu_reg(ctxt, r) (ctxt)->regs.regs[r]
|
|
#define DECLARE_REG(type, name, ctxt, reg) \
|
|
type name = (type)cpu_reg(ctxt, (reg))
|
|
|
|
#endif /* __ARM64_KVM_NVHE_TRAP_HANDLER_H__ */
|