Skip to content

Commit 9d52612

Browse files
Fuad TabbaMarc Zyngier
authored andcommitted
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
1 parent 21de26d commit 9d52612

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

arch/arm64/kvm/hyp/nvhe/pkvm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,10 @@ static void pvm_init_traps_aa64dfr0(struct kvm_vcpu *vcpu)
136136
cptr_set |= CPTR_EL2_TTA;
137137
}
138138

139+
/* Trap External Trace */
140+
if (!FIELD_GET(ARM64_FEATURE_MASK(ID_AA64DFR0_EL1_ExtTrcBuff), feature_ids))
141+
mdcr_clear |= MDCR_EL2_E2TB_MASK << MDCR_EL2_E2TB_SHIFT;
142+
139143
vcpu->arch.mdcr_el2 |= mdcr_set;
140144
vcpu->arch.mdcr_el2 &= ~mdcr_clear;
141145
vcpu->arch.cptr_el2 |= cptr_set;

0 commit comments

Comments
 (0)