ANDROID: arm64: Auto-enroll MMIO guard on protected vms

Set the MMIO guard flag for protected vms prior to entering the guest
for the first time.

Bug: 216798684
Signed-off-by: Sebastian Ene <sebastianene@google.com>
Change-Id: I1448102ae85176d495ae7f8d6d20de4092049f0d
This commit is contained in:
Sebastian Ene
2022-04-21 10:45:51 +00:00
parent 3e591c63b1
commit 6450df3d7e

View File

@@ -833,6 +833,10 @@ void pkvm_reset_vcpu(struct kvm_vcpu *vcpu)
*vcpu_pc(vcpu) = entry;
vm->pvmfw_entry_vcpu = NULL;
/* Auto enroll MMIO guard */
set_bit(KVM_ARCH_FLAG_MMIO_GUARD,
&vcpu->arch.pkvm.shadow_vm->arch.flags);
} else {
*vcpu_pc(vcpu) = reset_state->pc;
vcpu_set_reg(vcpu, 0, reset_state->r0);