Skip to content

Commit

Permalink
KVM: arm64: nv: Fold guest's HCR_EL2 configuration into the host's
Browse files Browse the repository at this point in the history
When entering a L2 guest (nested virt enabled, but not in hypervisor
context), we need to honor the traps the L1 guest has asked enabled.

For now, just OR the guest's HCR_EL2 into the host's. We may have to do
some filtering in the future though.

Signed-off-by: Marc Zyngier <maz@kernel.org>
  • Loading branch information
Marc Zyngier authored and intel-lab-lkp committed Dec 10, 2020
1 parent 34b8d2c commit 1072040
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/arm64/kvm/hyp/vhe/switch.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ static void __activate_traps(struct kvm_vcpu *vcpu)
if (!vcpu_el2_tge_is_set(vcpu))
hcr |= HCR_AT | HCR_TTLB;
}
} else if (nested_virt_in_use(vcpu)) {
hcr |= __vcpu_sys_reg(vcpu, HCR_EL2);
}

___activate_traps(vcpu, hcr);
Expand Down

0 comments on commit 1072040

Please sign in to comment.