KVM: arm64: Helper to write to appropriate feature trap register based on mode
authorFuad Tabba <tabba@google.com>
Mon, 24 Jul 2023 12:38:26 +0000 (13:38 +0100)
committerOliver Upton <oliver.upton@linux.dev>
Wed, 26 Jul 2023 17:08:29 +0000 (17:08 +0000)
commit90ae31c65d5afdd0864017c9354247ddb601917f
treede79ba18050f8db891b99cc05f5b2cfdcee8c5e8
parent380624d4358b0150804d279c20632555e453bc1f
KVM: arm64: Helper to write to appropriate feature trap register based on mode

Factor out the code that decides whether to write to the feature
trap registers, CPTR_EL2 or CPACR_EL1, based on the KVM mode,
i.e., (h)VHE or nVHE.

This function will be used in the subsequent patch.

No functional change intended.

Signed-off-by: Fuad Tabba <tabba@google.com>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20230724123829.2929609-6-tabba@google.com
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
arch/arm64/include/asm/kvm_emulate.h