1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2021 Western Digital Corporation or its affiliates.
6 * Atish Patra <atish.patra@wdc.com>
7 * Anup Patel <anup.patel@wdc.com>
10 #ifndef __KVM_VCPU_RISCV_FP_H
11 #define __KVM_VCPU_RISCV_FP_H
13 #include <linux/types.h>
15 struct kvm_cpu_context
;
18 void __kvm_riscv_fp_f_save(struct kvm_cpu_context
*context
);
19 void __kvm_riscv_fp_f_restore(struct kvm_cpu_context
*context
);
20 void __kvm_riscv_fp_d_save(struct kvm_cpu_context
*context
);
21 void __kvm_riscv_fp_d_restore(struct kvm_cpu_context
*context
);
23 void kvm_riscv_vcpu_fp_reset(struct kvm_vcpu
*vcpu
);
24 void kvm_riscv_vcpu_guest_fp_save(struct kvm_cpu_context
*cntx
,
25 const unsigned long *isa
);
26 void kvm_riscv_vcpu_guest_fp_restore(struct kvm_cpu_context
*cntx
,
27 const unsigned long *isa
);
28 void kvm_riscv_vcpu_host_fp_save(struct kvm_cpu_context
*cntx
);
29 void kvm_riscv_vcpu_host_fp_restore(struct kvm_cpu_context
*cntx
);
31 static inline void kvm_riscv_vcpu_fp_reset(struct kvm_vcpu
*vcpu
)
34 static inline void kvm_riscv_vcpu_guest_fp_save(struct kvm_cpu_context
*cntx
,
35 const unsigned long *isa
)
38 static inline void kvm_riscv_vcpu_guest_fp_restore(
39 struct kvm_cpu_context
*cntx
,
40 const unsigned long *isa
)
43 static inline void kvm_riscv_vcpu_host_fp_save(struct kvm_cpu_context
*cntx
)
46 static inline void kvm_riscv_vcpu_host_fp_restore(
47 struct kvm_cpu_context
*cntx
)
52 int kvm_riscv_vcpu_get_reg_fp(struct kvm_vcpu
*vcpu
,
53 const struct kvm_one_reg
*reg
,
55 int kvm_riscv_vcpu_set_reg_fp(struct kvm_vcpu
*vcpu
,
56 const struct kvm_one_reg
*reg
,