xref: /kvmtool/powerpc/include/kvm/kvm-cpu-arch.h (revision f17e5a37d51f6ec6d08373b4cfef9d09f01e76ba)
1 /*
2  * PPC64 cpu-specific definitions
3  *
4  * Copyright 2011 Matt Evans <matt@ozlabs.org>, IBM Corporation.
5  *
6  * This program is free software; you can redistribute it and/or modify it
7  * under the terms of the GNU General Public License version 2 as published
8  * by the Free Software Foundation.
9  */
10 
11 #ifndef KVM__KVM_CPU_ARCH_H
12 #define KVM__KVM_CPU_ARCH_H
13 
14 /* Architecture-specific kvm_cpu definitions. */
15 
16 #include <linux/kvm.h>	/* for struct kvm_regs */
17 
18 #include <pthread.h>
19 
20 #define MSR_SF		(1UL<<63)
21 #define MSR_HV		(1UL<<60)
22 #define MSR_VEC		(1UL<<25)
23 #define MSR_VSX		(1UL<<23)
24 #define MSR_POW		(1UL<<18)
25 #define MSR_EE		(1UL<<15)
26 #define MSR_PR		(1UL<<14)
27 #define MSR_FP		(1UL<<13)
28 #define MSR_ME		(1UL<<12)
29 #define MSR_FE0		(1UL<<11)
30 #define MSR_SE		(1UL<<10)
31 #define MSR_BE		(1UL<<9)
32 #define MSR_FE1		(1UL<<8)
33 #define MSR_IR		(1UL<<5)
34 #define MSR_DR		(1UL<<4)
35 #define MSR_PMM		(1UL<<2)
36 #define MSR_RI		(1UL<<1)
37 #define MSR_LE		(1UL<<0)
38 
39 #define POWER7_EXT_IRQ	0
40 
41 struct kvm;
42 
43 struct kvm_cpu {
44 	pthread_t		thread;		/* VCPU thread */
45 
46 	unsigned long		cpu_id;
47 
48 	struct kvm		*kvm;		/* parent KVM */
49 	int			vcpu_fd;	/* For VCPU ioctls() */
50 	struct kvm_run		*kvm_run;
51 
52 	struct kvm_regs		regs;
53 	struct kvm_sregs	sregs;
54 	struct kvm_fpu		fpu;
55 
56 	u8			is_running;
57 	u8			paused;
58 	u8			needs_nmi;
59 	/*
60 	 * Although PPC KVM doesn't yet support coalesced MMIO, generic code
61 	 * needs this in our kvm_cpu:
62 	 */
63 	struct kvm_coalesced_mmio_ring  *ring;
64 };
65 
66 void kvm_cpu__irq(struct kvm_cpu *vcpu, int pin, int level);
67 
68 #endif /* KVM__KVM_CPU_ARCH_H */
69