linux/arch/arm64/kvm
Marc Zyngier 1d6fea7663 KVM: arm64: Add helper to identify a nested context
A common idiom in the KVM code is to check if we are currently
dealing with a "nested" context, defined as having NV enabled,
but being in the EL1&0 translation regime.

This is usually expressed as:

	if (vcpu_has_nv(vcpu) && !is_hyp_ctxt(vcpu) ... )

which is a mouthful and a bit hard to read, specially when followed
by additional conditions.

Introduce a new helper that encapsulate these two terms, allowing
the above to be written as

	if (is_nested_context(vcpu) ... )

which is both shorter and easier to read, and makes more obvious
the potential for simplification on some code paths.

Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20250708172532.1699409-4-oliver.upton@linux.dev
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
2025-07-08 10:40:30 -07:00
..
hyp KVM: arm64: Add helper to identify a nested context 2025-07-08 10:40:30 -07:00
vgic KVM: arm64: Add helper to identify a nested context 2025-07-08 10:40:30 -07:00
.gitignore
arch_timer.c KVM: arm64: Add helper to identify a nested context 2025-07-08 10:40:30 -07:00
arm.c KVM: arm64: Add helper to identify a nested context 2025-07-08 10:40:30 -07:00
at.c Merge branch kvm-arm64/misc-6.16 into kvmarm-master/next 2025-05-23 10:59:43 +01:00
config.c KVM: arm64: Add sanitisation for FEAT_FGT2 registers 2025-05-19 11:36:10 +01:00
debug.c KVM: arm64: Add RMW specific sysreg accessor 2025-06-05 14:18:01 +01:00
emulate-nested.c KVM: arm64: Add helper to identify a nested context 2025-07-08 10:40:30 -07:00
fpsimd.c KVM: arm64: Don't use __vcpu_sys_reg() to get the address of a sysreg 2025-06-05 14:18:01 +01:00
guest.c
handle_exit.c KVM: arm64: Add helper to identify a nested context 2025-07-08 10:40:30 -07:00
hypercalls.c arm64: kvm, smccc: Introduce and use API for getting hypervisor UUID 2025-05-23 16:30:55 +00:00
inject_fault.c
Kconfig arm64: drop binutils version checks 2025-04-30 21:55:06 +02:00
Makefile KVM: arm64: Switch to table-driven FGU configuration 2025-05-10 11:04:35 +01:00
mmio.c
mmu.c KVM/arm64 updates for 6.16 2025-05-26 16:19:46 -04:00
nested.c KVM: arm64: Add RMW specific sysreg accessor 2025-06-05 14:18:01 +01:00
pauth.c
pkvm.c Merge branch kvm-arm64/misc-6.16 into kvmarm-master/next 2025-05-23 10:59:43 +01:00
pmu-emul.c KVM: arm64: Add RMW specific sysreg accessor 2025-06-05 14:18:01 +01:00
pmu.c KVM: arm64: Use a cpucap to determine if system supports FEAT_PMUv3 2025-03-11 12:54:23 -07:00
psci.c
ptdump.c KVM: arm64: ptdump: Test PMD_TYPE_MASK for block mapping 2025-03-12 12:20:59 +00:00
pvtime.c
reset.c KVM: arm64: nv: Add pseudo-TLB backing VNCR_EL2 2025-05-19 07:59:46 +01:00
stacktrace.c arm64: kvm: Introduce nvhe stack size constants 2025-01-08 11:25:28 +00:00
sys_regs.c KVM/arm64 fixes for 6.16, take #2 2025-06-11 14:25:22 -04:00
sys_regs.h KVM: arm64: Add assignment-specific sysreg accessor 2025-06-05 14:17:32 +01:00
trace.h
trace_arm.h KVM: arm64: Replace ternary flags with str_on_off() helper 2025-05-06 09:38:37 +01:00
trace_handle_exit.h
trng.c
va_layout.c
vgic-sys-reg-v3.c arm64: sysreg: Add layout for ICH_VTR_EL2 2025-03-03 14:51:51 -08:00
vmid.c KVM: arm64: Ensure a VMID is allocated before programming VTTBR_EL2 2025-02-20 16:29:28 +00:00