diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-02 17:50:10 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-04-02 17:50:10 -0400 |
commit | 7cbb39d4d4d530dff12f2ff06ed6c85c504ba91a (patch) | |
tree | 82f721591d739eca99817def86ca5b6ebd682fe6 /arch/s390/include/asm/kvm_host.h | |
parent | 64056a94256e7a476de67fbe581dfe5515c56288 (diff) | |
parent | 7227fc0666606b0df2c0d2966a7f4859b01bdf74 (diff) |
Merge tag 'kvm-3.15-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull kvm updates from Paolo Bonzini:
"PPC and ARM do not have much going on this time. Most of the cool
stuff, instead, is in s390 and (after a few releases) x86.
ARM has some caching fixes and PPC has transactional memory support in
guests. MIPS has some fixes, with more probably coming in 3.16 as
QEMU will soon get support for MIPS KVM.
For x86 there are optimizations for debug registers, which trigger on
some Windows games, and other important fixes for Windows guests. We
now expose to the guest Broadwell instruction set extensions and also
Intel MPX. There's also a fix/workaround for OS X guests, nested
virtualization features (preemption timer), and a couple kvmclock
refinements.
For s390, the main news is asynchronous page faults, together with
improvements to IRQs (floating irqs and adapter irqs) that speed up
virtio devices"
* tag 'kvm-3.15-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (96 commits)
KVM: PPC: Book3S HV: Save/restore host PMU registers that are new in POWER8
KVM: PPC: Book3S HV: Fix decrementer timeouts with non-zero TB offset
KVM: PPC: Book3S HV: Don't use kvm_memslots() in real mode
KVM: PPC: Book3S HV: Return ENODEV error rather than EIO
KVM: PPC: Book3S: Trim top 4 bits of physical address in RTAS code
KVM: PPC: Book3S HV: Add get/set_one_reg for new TM state
KVM: PPC: Book3S HV: Add transactional memory support
KVM: Specify byte order for KVM_EXIT_MMIO
KVM: vmx: fix MPX detection
KVM: PPC: Book3S HV: Fix KVM hang with CONFIG_KVM_XICS=n
KVM: PPC: Book3S: Introduce hypervisor call H_GET_TCE
KVM: PPC: Book3S HV: Fix incorrect userspace exit on ioeventfd write
KVM: s390: clear local interrupts at cpu initial reset
KVM: s390: Fix possible memory leak in SIGP functions
KVM: s390: fix calculation of idle_mask array size
KVM: s390: randomize sca address
KVM: ioapic: reinject pending interrupts on KVM_SET_IRQCHIP
KVM: Bump KVM_MAX_IRQ_ROUTES for s390
KVM: s390: irq routing for adapter interrupts.
KVM: s390: adapter interrupt sources
...
Diffstat (limited to 'arch/s390/include/asm/kvm_host.h')
-rw-r--r-- | arch/s390/include/asm/kvm_host.h | 98 |
1 files changed, 61 insertions, 37 deletions
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index 9bf95bb30f1a..154b60089be9 100644 --- a/arch/s390/include/asm/kvm_host.h +++ b/arch/s390/include/asm/kvm_host.h | |||
@@ -16,12 +16,22 @@ | |||
16 | #include <linux/hrtimer.h> | 16 | #include <linux/hrtimer.h> |
17 | #include <linux/interrupt.h> | 17 | #include <linux/interrupt.h> |
18 | #include <linux/kvm_host.h> | 18 | #include <linux/kvm_host.h> |
19 | #include <linux/kvm.h> | ||
19 | #include <asm/debug.h> | 20 | #include <asm/debug.h> |
20 | #include <asm/cpu.h> | 21 | #include <asm/cpu.h> |
22 | #include <asm/isc.h> | ||
21 | 23 | ||
22 | #define KVM_MAX_VCPUS 64 | 24 | #define KVM_MAX_VCPUS 64 |
23 | #define KVM_USER_MEM_SLOTS 32 | 25 | #define KVM_USER_MEM_SLOTS 32 |
24 | 26 | ||
27 | /* | ||
28 | * These seem to be used for allocating ->chip in the routing table, | ||
29 | * which we don't use. 4096 is an out-of-thin-air value. If we need | ||
30 | * to look at ->chip later on, we'll need to revisit this. | ||
31 | */ | ||
32 | #define KVM_NR_IRQCHIPS 1 | ||
33 | #define KVM_IRQCHIP_NUM_PINS 4096 | ||
34 | |||
25 | struct sca_entry { | 35 | struct sca_entry { |
26 | atomic_t scn; | 36 | atomic_t scn; |
27 | __u32 reserved; | 37 | __u32 reserved; |
@@ -108,7 +118,9 @@ struct kvm_s390_sie_block { | |||
108 | __u32 fac; /* 0x01a0 */ | 118 | __u32 fac; /* 0x01a0 */ |
109 | __u8 reserved1a4[20]; /* 0x01a4 */ | 119 | __u8 reserved1a4[20]; /* 0x01a4 */ |
110 | __u64 cbrlo; /* 0x01b8 */ | 120 | __u64 cbrlo; /* 0x01b8 */ |
111 | __u8 reserved1c0[40]; /* 0x01c0 */ | 121 | __u8 reserved1c0[30]; /* 0x01c0 */ |
122 | __u64 pp; /* 0x01de */ | ||
123 | __u8 reserved1e6[2]; /* 0x01e6 */ | ||
112 | __u64 itdba; /* 0x01e8 */ | 124 | __u64 itdba; /* 0x01e8 */ |
113 | __u8 reserved1f0[16]; /* 0x01f0 */ | 125 | __u8 reserved1f0[16]; /* 0x01f0 */ |
114 | } __attribute__((packed)); | 126 | } __attribute__((packed)); |
@@ -171,18 +183,6 @@ struct kvm_vcpu_stat { | |||
171 | u32 diagnose_9c; | 183 | u32 diagnose_9c; |
172 | }; | 184 | }; |
173 | 185 | ||
174 | struct kvm_s390_io_info { | ||
175 | __u16 subchannel_id; /* 0x0b8 */ | ||
176 | __u16 subchannel_nr; /* 0x0ba */ | ||
177 | __u32 io_int_parm; /* 0x0bc */ | ||
178 | __u32 io_int_word; /* 0x0c0 */ | ||
179 | }; | ||
180 | |||
181 | struct kvm_s390_ext_info { | ||
182 | __u32 ext_params; | ||
183 | __u64 ext_params2; | ||
184 | }; | ||
185 | |||
186 | #define PGM_OPERATION 0x01 | 186 | #define PGM_OPERATION 0x01 |
187 | #define PGM_PRIVILEGED_OP 0x02 | 187 | #define PGM_PRIVILEGED_OP 0x02 |
188 | #define PGM_EXECUTE 0x03 | 188 | #define PGM_EXECUTE 0x03 |
@@ -191,27 +191,6 @@ struct kvm_s390_ext_info { | |||
191 | #define PGM_SPECIFICATION 0x06 | 191 | #define PGM_SPECIFICATION 0x06 |
192 | #define PGM_DATA 0x07 | 192 | #define PGM_DATA 0x07 |
193 | 193 | ||
194 | struct kvm_s390_pgm_info { | ||
195 | __u16 code; | ||
196 | }; | ||
197 | |||
198 | struct kvm_s390_prefix_info { | ||
199 | __u32 address; | ||
200 | }; | ||
201 | |||
202 | struct kvm_s390_extcall_info { | ||
203 | __u16 code; | ||
204 | }; | ||
205 | |||
206 | struct kvm_s390_emerg_info { | ||
207 | __u16 code; | ||
208 | }; | ||
209 | |||
210 | struct kvm_s390_mchk_info { | ||
211 | __u64 cr14; | ||
212 | __u64 mcic; | ||
213 | }; | ||
214 | |||
215 | struct kvm_s390_interrupt_info { | 194 | struct kvm_s390_interrupt_info { |
216 | struct list_head list; | 195 | struct list_head list; |
217 | u64 type; | 196 | u64 type; |
@@ -246,9 +225,8 @@ struct kvm_s390_float_interrupt { | |||
246 | struct list_head list; | 225 | struct list_head list; |
247 | atomic_t active; | 226 | atomic_t active; |
248 | int next_rr_cpu; | 227 | int next_rr_cpu; |
249 | unsigned long idle_mask[(KVM_MAX_VCPUS + sizeof(long) - 1) | 228 | unsigned long idle_mask[BITS_TO_LONGS(KVM_MAX_VCPUS)]; |
250 | / sizeof(long)]; | 229 | unsigned int irq_count; |
251 | struct kvm_s390_local_interrupt *local_int[KVM_MAX_VCPUS]; | ||
252 | }; | 230 | }; |
253 | 231 | ||
254 | 232 | ||
@@ -265,6 +243,10 @@ struct kvm_vcpu_arch { | |||
265 | u64 stidp_data; | 243 | u64 stidp_data; |
266 | }; | 244 | }; |
267 | struct gmap *gmap; | 245 | struct gmap *gmap; |
246 | #define KVM_S390_PFAULT_TOKEN_INVALID (-1UL) | ||
247 | unsigned long pfault_token; | ||
248 | unsigned long pfault_select; | ||
249 | unsigned long pfault_compare; | ||
268 | }; | 250 | }; |
269 | 251 | ||
270 | struct kvm_vm_stat { | 252 | struct kvm_vm_stat { |
@@ -274,12 +256,36 @@ struct kvm_vm_stat { | |||
274 | struct kvm_arch_memory_slot { | 256 | struct kvm_arch_memory_slot { |
275 | }; | 257 | }; |
276 | 258 | ||
259 | struct s390_map_info { | ||
260 | struct list_head list; | ||
261 | __u64 guest_addr; | ||
262 | __u64 addr; | ||
263 | struct page *page; | ||
264 | }; | ||
265 | |||
266 | struct s390_io_adapter { | ||
267 | unsigned int id; | ||
268 | int isc; | ||
269 | bool maskable; | ||
270 | bool masked; | ||
271 | bool swap; | ||
272 | struct rw_semaphore maps_lock; | ||
273 | struct list_head maps; | ||
274 | atomic_t nr_maps; | ||
275 | }; | ||
276 | |||
277 | #define MAX_S390_IO_ADAPTERS ((MAX_ISC + 1) * 8) | ||
278 | #define MAX_S390_ADAPTER_MAPS 256 | ||
279 | |||
277 | struct kvm_arch{ | 280 | struct kvm_arch{ |
278 | struct sca_block *sca; | 281 | struct sca_block *sca; |
279 | debug_info_t *dbf; | 282 | debug_info_t *dbf; |
280 | struct kvm_s390_float_interrupt float_int; | 283 | struct kvm_s390_float_interrupt float_int; |
284 | struct kvm_device *flic; | ||
281 | struct gmap *gmap; | 285 | struct gmap *gmap; |
282 | int css_support; | 286 | int css_support; |
287 | int use_irqchip; | ||
288 | struct s390_io_adapter *adapters[MAX_S390_IO_ADAPTERS]; | ||
283 | }; | 289 | }; |
284 | 290 | ||
285 | #define KVM_HVA_ERR_BAD (-1UL) | 291 | #define KVM_HVA_ERR_BAD (-1UL) |
@@ -290,6 +296,24 @@ static inline bool kvm_is_error_hva(unsigned long addr) | |||
290 | return IS_ERR_VALUE(addr); | 296 | return IS_ERR_VALUE(addr); |
291 | } | 297 | } |
292 | 298 | ||
299 | #define ASYNC_PF_PER_VCPU 64 | ||
300 | struct kvm_vcpu; | ||
301 | struct kvm_async_pf; | ||
302 | struct kvm_arch_async_pf { | ||
303 | unsigned long pfault_token; | ||
304 | }; | ||
305 | |||
306 | bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu); | ||
307 | |||
308 | void kvm_arch_async_page_ready(struct kvm_vcpu *vcpu, | ||
309 | struct kvm_async_pf *work); | ||
310 | |||
311 | void kvm_arch_async_page_not_present(struct kvm_vcpu *vcpu, | ||
312 | struct kvm_async_pf *work); | ||
313 | |||
314 | void kvm_arch_async_page_present(struct kvm_vcpu *vcpu, | ||
315 | struct kvm_async_pf *work); | ||
316 | |||
293 | extern int sie64a(struct kvm_s390_sie_block *, u64 *); | 317 | extern int sie64a(struct kvm_s390_sie_block *, u64 *); |
294 | extern char sie_exit; | 318 | extern char sie_exit; |
295 | #endif | 319 | #endif |