summaryrefslogtreecommitdiff
path: root/arch/s390/include/asm/sae.h
blob: 26d89fae0836bbd64b1d781598ac320e35d09958 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/* SPDX-License-Identifier: GPL-2.0 */
#ifndef __ASM_S390_SAE_H
#define __ASM_S390_SAE_H

#include <linux/linkage.h>
#include <linux/types.h>

#ifndef __ASSEMBLER__

/* defined in arch/s390/kernel/entry.S */
asmlinkage void sae(phys_addr_t sae_block_phys);

#include <linux/io.h>
#include <asm/kvm_host_arm64_types.h>

/**
 * stiasrm() - STore and Invalidate Arm System Register Multiple
 * @save_area: Pointer to SAE save area
 *
 * Store the guest system registers to the save area.
 * The values in the guest are no longer valid.
 */
static __always_inline void stiasrm(struct kvm_sae_save_area *save_area)
{
	asm_inline volatile(
		"	.insn	rre,0xb9a70000,%[r1],0\n"
		: "+m" (*save_area)
		: [r1] "a" (save_area)
	);
}

/**
 * lasrm() - Load Arm System Register Multiple
 *
 * @save_area: Pointer to SAE save area
 *
 * Load the system registers from save_area into the guest.
 */
static __always_inline void lasrm(struct kvm_sae_save_area *save_area)
{
	asm_inline volatile(
		"	.insn	rre,0xb9a60000,%[r1],0\n"
		:
		: "m" (*save_area), [r1] "a" (save_area)
	);
}

#endif /* !__ASSEMBLER__ */
#endif /* __ASM_S390_SAE_H */