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

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/kvm_booke.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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-only */
  2 /*
  3  *
  4  * Copyright SUSE Linux Products GmbH 2010
  5  *
  6  * Authors: Alexander Graf <agraf@suse.de>
  7  */
  8 
  9 #ifndef __ASM_KVM_BOOKE_H__
 10 #define __ASM_KVM_BOOKE_H__
 11 
 12 #include <linux/types.h>
 13 #include <linux/kvm_host.h>
 14 
 15 /*
 16  * Number of available lpids. Only the low-order 6 bits of LPID rgister are
 17  * implemented on e500mc+ cores.
 18  */
 19 #define KVMPPC_NR_LPIDS                        64
 20 
 21 #define KVMPPC_INST_EHPRIV              0x7c00021c
 22 #define EHPRIV_OC_SHIFT                 11
 23 /* "ehpriv 1" : ehpriv with OC = 1 is used for debug emulation */
 24 #define EHPRIV_OC_DEBUG                 1
 25 
 26 static inline void kvmppc_set_gpr(struct kvm_vcpu *vcpu, int num, ulong val)
 27 {
 28         vcpu->arch.regs.gpr[num] = val;
 29 }
 30 
 31 static inline ulong kvmppc_get_gpr(struct kvm_vcpu *vcpu, int num)
 32 {
 33         return vcpu->arch.regs.gpr[num];
 34 }
 35 
 36 static inline void kvmppc_set_cr(struct kvm_vcpu *vcpu, u32 val)
 37 {
 38         vcpu->arch.regs.ccr = val;
 39 }
 40 
 41 static inline u32 kvmppc_get_cr(struct kvm_vcpu *vcpu)
 42 {
 43         return vcpu->arch.regs.ccr;
 44 }
 45 
 46 static inline void kvmppc_set_xer(struct kvm_vcpu *vcpu, ulong val)
 47 {
 48         vcpu->arch.regs.xer = val;
 49 }
 50 
 51 static inline ulong kvmppc_get_xer(struct kvm_vcpu *vcpu)
 52 {
 53         return vcpu->arch.regs.xer;
 54 }
 55 
 56 static inline bool kvmppc_need_byteswap(struct kvm_vcpu *vcpu)
 57 {
 58         /* XXX Would need to check TLB entry */
 59         return false;
 60 }
 61 
 62 static inline void kvmppc_set_ctr(struct kvm_vcpu *vcpu, ulong val)
 63 {
 64         vcpu->arch.regs.ctr = val;
 65 }
 66 
 67 static inline ulong kvmppc_get_ctr(struct kvm_vcpu *vcpu)
 68 {
 69         return vcpu->arch.regs.ctr;
 70 }
 71 
 72 static inline void kvmppc_set_lr(struct kvm_vcpu *vcpu, ulong val)
 73 {
 74         vcpu->arch.regs.link = val;
 75 }
 76 
 77 static inline ulong kvmppc_get_lr(struct kvm_vcpu *vcpu)
 78 {
 79         return vcpu->arch.regs.link;
 80 }
 81 
 82 static inline void kvmppc_set_pc(struct kvm_vcpu *vcpu, ulong val)
 83 {
 84         vcpu->arch.regs.nip = val;
 85 }
 86 
 87 static inline ulong kvmppc_get_pc(struct kvm_vcpu *vcpu)
 88 {
 89         return vcpu->arch.regs.nip;
 90 }
 91 
 92 static inline void kvmppc_set_fpr(struct kvm_vcpu *vcpu, int i, u64 val)
 93 {
 94         vcpu->arch.fp.fpr[i][TS_FPROFFSET] = val;
 95 }
 96 
 97 static inline u64 kvmppc_get_fpr(struct kvm_vcpu *vcpu, int i)
 98 {
 99         return vcpu->arch.fp.fpr[i][TS_FPROFFSET];
100 }
101 
102 #ifdef CONFIG_BOOKE
103 static inline ulong kvmppc_get_fault_dar(struct kvm_vcpu *vcpu)
104 {
105         return vcpu->arch.fault_dear;
106 }
107 #endif
108 
109 static inline bool kvmppc_supports_magic_page(struct kvm_vcpu *vcpu)
110 {
111         /* Magic page is only supported on e500v2 */
112 #ifdef CONFIG_KVM_E500V2
113         return true;
114 #else
115         return false;
116 #endif
117 }
118 #endif /* __ASM_KVM_BOOKE_H__ */
119 

~ [ 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