The 32-bit sysreg saving process can be made common between switches to
a guest or to the host because the host vcpu is not 32-bit so the saving
will be skipped.

Signed-off-by: Andrew Scull <[email protected]>
---
 arch/arm64/kvm/hyp/nvhe/switch.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm64/kvm/hyp/nvhe/switch.c b/arch/arm64/kvm/hyp/nvhe/switch.c
index 0cabb8ce7d68..a23eba0ccd3e 100644
--- a/arch/arm64/kvm/hyp/nvhe/switch.c
+++ b/arch/arm64/kvm/hyp/nvhe/switch.c
@@ -180,7 +180,6 @@ static void __kvm_vcpu_switch_to_host(struct kvm_vcpu 
*host_vcpu,
 {
        struct kvm_cpu_context *guest_ctxt = &vcpu->arch.ctxt;
 
-       __sysreg32_save_state(vcpu);
        __timer_disable_traps(vcpu);
        __hyp_vgic_save_state(vcpu);
 
@@ -208,6 +207,7 @@ static void __kvm_vcpu_switch_to_host(struct kvm_vcpu 
*host_vcpu,
 static void __vcpu_save_state(struct kvm_vcpu *vcpu)
 {
        __sysreg_save_state_nvhe(&vcpu->arch.ctxt);
+       __sysreg32_save_state(vcpu);
 }
 
 static void __vcpu_restore_state(struct kvm_vcpu *vcpu)
-- 
2.27.0.389.gc38d7665816-goog

_______________________________________________
kvmarm mailing list
[email protected]
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm

Reply via email to