mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-03 17:51:23 +00:00

Move pkvm_vcpu_init_traps() to the initialization of the hypervisor's vcpu state in init_pkvm_hyp_vcpu(), and remove the associated hypercall. In protected mode, traps need to be initialized whenever a VCPU is initialized anyway, and not only for protected VMs. This also saves an unnecessary hypercall. Signed-off-by: Fuad Tabba <tabba@google.com> Link: https://lore.kernel.org/r/20241018074833.2563674-2-tabba@google.com Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
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__ */
|