~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/loongarch/include/uapi/asm/kvm.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
  2 /*
  3  * Copyright (C) 2020-2023 Loongson Technology Corporation Limited
  4  */
  5 
  6 #ifndef __UAPI_ASM_LOONGARCH_KVM_H
  7 #define __UAPI_ASM_LOONGARCH_KVM_H
  8 
  9 #include <linux/types.h>
 10 
 11 /*
 12  * KVM LoongArch specific structures and definitions.
 13  *
 14  * Some parts derived from the x86 version of this file.
 15  */
 16 
 17 #define KVM_COALESCED_MMIO_PAGE_OFFSET  1
 18 #define KVM_DIRTY_LOG_PAGE_OFFSET       64
 19 
 20 #define KVM_GUESTDBG_USE_SW_BP          0x00010000
 21 
 22 /*
 23  * for KVM_GET_REGS and KVM_SET_REGS
 24  */
 25 struct kvm_regs {
 26         /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
 27         __u64 gpr[32];
 28         __u64 pc;
 29 };
 30 
 31 /*
 32  * for KVM_GET_FPU and KVM_SET_FPU
 33  */
 34 struct kvm_fpu {
 35         __u32 fcsr;
 36         __u64 fcc;    /* 8x8 */
 37         struct kvm_fpureg {
 38                 __u64 val64[4];
 39         } fpr[32];
 40 };
 41 
 42 /*
 43  * For LoongArch, we use KVM_SET_ONE_REG and KVM_GET_ONE_REG to access various
 44  * registers.  The id field is broken down as follows:
 45  *
 46  *  bits[63..52] - As per linux/kvm.h
 47  *  bits[51..32] - Must be zero.
 48  *  bits[31..16] - Register set.
 49  *
 50  * Register set = 0: GP registers from kvm_regs (see definitions below).
 51  *
 52  * Register set = 1: CSR registers.
 53  *
 54  * Register set = 2: KVM specific registers (see definitions below).
 55  *
 56  * Register set = 3: FPU / SIMD registers (see definitions below).
 57  *
 58  * Other sets registers may be added in the future.  Each set would
 59  * have its own identifier in bits[31..16].
 60  */
 61 
 62 #define KVM_REG_LOONGARCH_GPR           (KVM_REG_LOONGARCH | 0x00000ULL)
 63 #define KVM_REG_LOONGARCH_CSR           (KVM_REG_LOONGARCH | 0x10000ULL)
 64 #define KVM_REG_LOONGARCH_KVM           (KVM_REG_LOONGARCH | 0x20000ULL)
 65 #define KVM_REG_LOONGARCH_FPSIMD        (KVM_REG_LOONGARCH | 0x30000ULL)
 66 #define KVM_REG_LOONGARCH_CPUCFG        (KVM_REG_LOONGARCH | 0x40000ULL)
 67 #define KVM_REG_LOONGARCH_MASK          (KVM_REG_LOONGARCH | 0x70000ULL)
 68 #define KVM_CSR_IDX_MASK                0x7fff
 69 #define KVM_CPUCFG_IDX_MASK             0x7fff
 70 
 71 /*
 72  * KVM_REG_LOONGARCH_KVM - KVM specific control registers.
 73  */
 74 
 75 #define KVM_REG_LOONGARCH_COUNTER       (KVM_REG_LOONGARCH_KVM | KVM_REG_SIZE_U64 | 1)
 76 #define KVM_REG_LOONGARCH_VCPU_RESET    (KVM_REG_LOONGARCH_KVM | KVM_REG_SIZE_U64 | 2)
 77 /* Debugging: Special instruction for software breakpoint */
 78 #define KVM_REG_LOONGARCH_DEBUG_INST    (KVM_REG_LOONGARCH_KVM | KVM_REG_SIZE_U64 | 3)
 79 
 80 #define LOONGARCH_REG_SHIFT             3
 81 #define LOONGARCH_REG_64(TYPE, REG)     (TYPE | KVM_REG_SIZE_U64 | (REG << LOONGARCH_REG_SHIFT))
 82 #define KVM_IOC_CSRID(REG)              LOONGARCH_REG_64(KVM_REG_LOONGARCH_CSR, REG)
 83 #define KVM_IOC_CPUCFG(REG)             LOONGARCH_REG_64(KVM_REG_LOONGARCH_CPUCFG, REG)
 84 
 85 /* Device Control API on vcpu fd */
 86 #define KVM_LOONGARCH_VCPU_CPUCFG       0
 87 #define KVM_LOONGARCH_VCPU_PVTIME_CTRL  1
 88 #define  KVM_LOONGARCH_VCPU_PVTIME_GPA  0
 89 
 90 struct kvm_debug_exit_arch {
 91 };
 92 
 93 /* for KVM_SET_GUEST_DEBUG */
 94 struct kvm_guest_debug_arch {
 95 };
 96 
 97 /* definition of registers in kvm_run */
 98 struct kvm_sync_regs {
 99 };
100 
101 /* dummy definition */
102 struct kvm_sregs {
103 };
104 
105 struct kvm_iocsr_entry {
106         __u32 addr;
107         __u32 pad;
108         __u64 data;
109 };
110 
111 #define KVM_NR_IRQCHIPS         1
112 #define KVM_IRQCHIP_NUM_PINS    64
113 #define KVM_MAX_CORES           256
114 
115 #endif /* __UAPI_ASM_LOONGARCH_KVM_H */
116 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php