summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorFuad Tabba <tabba@google.com>2023-12-14 13:01:57 +0300
committerMarc Zyngier <maz@kernel.org>2023-12-18 14:25:51 +0300
commit9d52612690985fc0ee1ae1fbad61530a4f6bbb53 (patch)
tree9552fbd32c1e280bd1dc798546baed51e90fc09c /arch
parent21de26dbc5170dde8e4dfbfa1ecb77804ed6a377 (diff)
downloadlinux-9d52612690985fc0ee1ae1fbad61530a4f6bbb53.tar.xz
KVM: arm64: Trap external trace for protected VMs
pKVM does not support external trace for protected VMs. Trap external trace, and add the ExtTrcBuff to make it possible to check for the feature. Signed-off-by: Fuad Tabba <tabba@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20231214100158.2305400-18-tabba@google.com
Diffstat (limited to 'arch')
-rw-r--r--arch/arm64/kvm/hyp/nvhe/pkvm.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/arm64/kvm/hyp/nvhe/pkvm.c b/arch/arm64/kvm/hyp/nvhe/pkvm.c
index 9d23a51d7f75..84b5c3f387d8 100644
--- a/arch/arm64/kvm/hyp/nvhe/pkvm.c
+++ b/arch/arm64/kvm/hyp/nvhe/pkvm.c
@@ -136,6 +136,10 @@ static void pvm_init_traps_aa64dfr0(struct kvm_vcpu *vcpu)
cptr_set |= CPTR_EL2_TTA;
}
+ /* Trap External Trace */
+ if (!FIELD_GET(ARM64_FEATURE_MASK(ID_AA64DFR0_EL1_ExtTrcBuff), feature_ids))
+ mdcr_clear |= MDCR_EL2_E2TB_MASK << MDCR_EL2_E2TB_SHIFT;
+
vcpu->arch.mdcr_el2 |= mdcr_set;
vcpu->arch.mdcr_el2 &= ~mdcr_clear;
vcpu->arch.cptr_el2 |= cptr_set;