cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

kvm_vcpu_fp.h (1700B)


      1/* SPDX-License-Identifier: GPL-2.0-only */
      2/*
      3 * Copyright (C) 2021 Western Digital Corporation or its affiliates.
      4 *
      5 * Authors:
      6 *     Atish Patra <atish.patra@wdc.com>
      7 *     Anup Patel <anup.patel@wdc.com>
      8 */
      9
     10#ifndef __KVM_VCPU_RISCV_FP_H
     11#define __KVM_VCPU_RISCV_FP_H
     12
     13#include <linux/types.h>
     14
     15struct kvm_cpu_context;
     16
     17#ifdef CONFIG_FPU
     18void __kvm_riscv_fp_f_save(struct kvm_cpu_context *context);
     19void __kvm_riscv_fp_f_restore(struct kvm_cpu_context *context);
     20void __kvm_riscv_fp_d_save(struct kvm_cpu_context *context);
     21void __kvm_riscv_fp_d_restore(struct kvm_cpu_context *context);
     22
     23void kvm_riscv_vcpu_fp_reset(struct kvm_vcpu *vcpu);
     24void kvm_riscv_vcpu_guest_fp_save(struct kvm_cpu_context *cntx,
     25				  unsigned long isa);
     26void kvm_riscv_vcpu_guest_fp_restore(struct kvm_cpu_context *cntx,
     27				     unsigned long isa);
     28void kvm_riscv_vcpu_host_fp_save(struct kvm_cpu_context *cntx);
     29void kvm_riscv_vcpu_host_fp_restore(struct kvm_cpu_context *cntx);
     30#else
     31static inline void kvm_riscv_vcpu_fp_reset(struct kvm_vcpu *vcpu)
     32{
     33}
     34static inline void kvm_riscv_vcpu_guest_fp_save(struct kvm_cpu_context *cntx,
     35						unsigned long isa)
     36{
     37}
     38static inline void kvm_riscv_vcpu_guest_fp_restore(
     39					struct kvm_cpu_context *cntx,
     40					unsigned long isa)
     41{
     42}
     43static inline void kvm_riscv_vcpu_host_fp_save(struct kvm_cpu_context *cntx)
     44{
     45}
     46static inline void kvm_riscv_vcpu_host_fp_restore(
     47					struct kvm_cpu_context *cntx)
     48{
     49}
     50#endif
     51
     52int kvm_riscv_vcpu_get_reg_fp(struct kvm_vcpu *vcpu,
     53			      const struct kvm_one_reg *reg,
     54			      unsigned long rtype);
     55int kvm_riscv_vcpu_set_reg_fp(struct kvm_vcpu *vcpu,
     56			      const struct kvm_one_reg *reg,
     57			      unsigned long rtype);
     58
     59#endif