Skip to content

Commit de5c282

Browse files
Marc Zyngieroupton
authored andcommitted
KVM: arm64: Add save/restore support for POR_EL2
POR_EL2 needs saving when the guest is VHE, and restoring in any case. Signed-off-by: Marc Zyngier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 5970e99 commit de5c282

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

arch/arm64/kvm/hyp/vhe/sysreg-sr.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ static void __sysreg_save_vel2_state(struct kvm_vcpu *vcpu)
5858
__vcpu_sys_reg(vcpu, PIRE0_EL2) = read_sysreg_el1(SYS_PIRE0);
5959
__vcpu_sys_reg(vcpu, PIR_EL2) = read_sysreg_el1(SYS_PIR);
6060
}
61+
62+
if (ctxt_has_s1poe(&vcpu->arch.ctxt))
63+
__vcpu_sys_reg(vcpu, POR_EL2) = read_sysreg_el1(SYS_POR);
6164
}
6265

6366
/*
@@ -123,6 +126,9 @@ static void __sysreg_restore_vel2_state(struct kvm_vcpu *vcpu)
123126
write_sysreg_el1(__vcpu_sys_reg(vcpu, PIR_EL2), SYS_PIR);
124127
write_sysreg_el1(__vcpu_sys_reg(vcpu, PIRE0_EL2), SYS_PIRE0);
125128
}
129+
130+
if (ctxt_has_s1poe(&vcpu->arch.ctxt))
131+
write_sysreg_el1(__vcpu_sys_reg(vcpu, POR_EL2), SYS_POR);
126132
}
127133

128134
write_sysreg_el1(__vcpu_sys_reg(vcpu, ESR_EL2), SYS_ESR);

0 commit comments

Comments
 (0)