xref: /linux/arch/arm64/kvm/hyp/nvhe/sysreg-sr.c (revision cdd38c5f1ce4398ec58fec95904b75824daab7b5)
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3  * Copyright (C) 2012-2015 - ARM Ltd
4  * Author: Marc Zyngier <marc.zyngier@arm.com>
5  */
6 
7 #include <hyp/sysreg-sr.h>
8 
9 #include <linux/compiler.h>
10 #include <linux/kvm_host.h>
11 
12 #include <asm/kprobes.h>
13 #include <asm/kvm_asm.h>
14 #include <asm/kvm_emulate.h>
15 #include <asm/kvm_hyp.h>
16 
17 /*
18  * Non-VHE: Both host and guest must save everything.
19  */
20 
__sysreg_save_state_nvhe(struct kvm_cpu_context * ctxt)21 void __sysreg_save_state_nvhe(struct kvm_cpu_context *ctxt)
22 {
23 	__sysreg_save_el1_state(ctxt);
24 	__sysreg_save_common_state(ctxt);
25 	__sysreg_save_user_state(ctxt);
26 	__sysreg_save_el2_return_state(ctxt);
27 }
28 
__sysreg_restore_state_nvhe(struct kvm_cpu_context * ctxt)29 void __sysreg_restore_state_nvhe(struct kvm_cpu_context *ctxt)
30 {
31 	__sysreg_restore_el1_state(ctxt);
32 	__sysreg_restore_common_state(ctxt);
33 	__sysreg_restore_user_state(ctxt);
34 	__sysreg_restore_el2_return_state(ctxt);
35 }
36