aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/include
diff options
context:
space:
mode:
authorJens Freimann <jfrei@linux.vnet.ibm.com>2013-07-29 14:54:15 -0400
committerChristian Borntraeger <borntraeger@de.ibm.com>2014-11-28 07:59:04 -0500
commitc0e6159d519ec429ebf0d54025726cbe41b9e456 (patch)
treece70141be2a2a9dca208d04253c6a1781bef4e83 /arch/s390/include
parent0fb97abe050348bf3bc1796329e75ac522de6b14 (diff)
KVM: s390: add bitmap for handling cpu-local interrupts
Adds a bitmap to the vcpu structure which is used to keep track of local pending interrupts. Also add enum with all interrupt types sorted in order of priority (highest to lowest) Signed-off-by: Jens Freimann <jfrei@linux.vnet.ibm.com> Reviewed-by: Thomas Huth <thuth@linux.vnet.ibm.com> Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com> Reviewed-by: David Hildenbrand <dahi@linux.vnet.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r--arch/s390/include/asm/kvm_host.h86
1 files changed, 86 insertions, 0 deletions
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h
index ac7b074952f1..624a821fcba0 100644
--- a/arch/s390/include/asm/kvm_host.h
+++ b/arch/s390/include/asm/kvm_host.h
@@ -295,6 +295,79 @@ struct kvm_vcpu_stat {
295#define PGM_PER 0x80 295#define PGM_PER 0x80
296#define PGM_CRYPTO_OPERATION 0x119 296#define PGM_CRYPTO_OPERATION 0x119
297 297
298/* irq types in order of priority */
299enum irq_types {
300 IRQ_PEND_MCHK_EX = 0,
301 IRQ_PEND_SVC,
302 IRQ_PEND_PROG,
303 IRQ_PEND_MCHK_REP,
304 IRQ_PEND_EXT_IRQ_KEY,
305 IRQ_PEND_EXT_MALFUNC,
306 IRQ_PEND_EXT_EMERGENCY,
307 IRQ_PEND_EXT_EXTERNAL,
308 IRQ_PEND_EXT_CLOCK_COMP,
309 IRQ_PEND_EXT_CPU_TIMER,
310 IRQ_PEND_EXT_TIMING,
311 IRQ_PEND_EXT_SERVICE,
312 IRQ_PEND_EXT_HOST,
313 IRQ_PEND_PFAULT_INIT,
314 IRQ_PEND_PFAULT_DONE,
315 IRQ_PEND_VIRTIO,
316 IRQ_PEND_IO_ISC_0,
317 IRQ_PEND_IO_ISC_1,
318 IRQ_PEND_IO_ISC_2,
319 IRQ_PEND_IO_ISC_3,
320 IRQ_PEND_IO_ISC_4,
321 IRQ_PEND_IO_ISC_5,
322 IRQ_PEND_IO_ISC_6,
323 IRQ_PEND_IO_ISC_7,
324 IRQ_PEND_SIGP_STOP,
325 IRQ_PEND_RESTART,
326 IRQ_PEND_SET_PREFIX,
327 IRQ_PEND_COUNT
328};
329
330/*
331 * Repressible (non-floating) machine check interrupts
332 * subclass bits in MCIC
333 */
334#define MCHK_EXTD_BIT 58
335#define MCHK_DEGR_BIT 56
336#define MCHK_WARN_BIT 55
337#define MCHK_REP_MASK ((1UL << MCHK_DEGR_BIT) | \
338 (1UL << MCHK_EXTD_BIT) | \
339 (1UL << MCHK_WARN_BIT))
340
341/* Exigent machine check interrupts subclass bits in MCIC */
342#define MCHK_SD_BIT 63
343#define MCHK_PD_BIT 62
344#define MCHK_EX_MASK ((1UL << MCHK_SD_BIT) | (1UL << MCHK_PD_BIT))
345
346#define IRQ_PEND_EXT_MASK ((1UL << IRQ_PEND_EXT_IRQ_KEY) | \
347 (1UL << IRQ_PEND_EXT_CLOCK_COMP) | \
348 (1UL << IRQ_PEND_EXT_CPU_TIMER) | \
349 (1UL << IRQ_PEND_EXT_MALFUNC) | \
350 (1UL << IRQ_PEND_EXT_EMERGENCY) | \
351 (1UL << IRQ_PEND_EXT_EXTERNAL) | \
352 (1UL << IRQ_PEND_EXT_TIMING) | \
353 (1UL << IRQ_PEND_EXT_HOST) | \
354 (1UL << IRQ_PEND_EXT_SERVICE) | \
355 (1UL << IRQ_PEND_VIRTIO) | \
356 (1UL << IRQ_PEND_PFAULT_INIT) | \
357 (1UL << IRQ_PEND_PFAULT_DONE))
358
359#define IRQ_PEND_IO_MASK ((1UL << IRQ_PEND_IO_ISC_0) | \
360 (1UL << IRQ_PEND_IO_ISC_1) | \
361 (1UL << IRQ_PEND_IO_ISC_2) | \
362 (1UL << IRQ_PEND_IO_ISC_3) | \
363 (1UL << IRQ_PEND_IO_ISC_4) | \
364 (1UL << IRQ_PEND_IO_ISC_5) | \
365 (1UL << IRQ_PEND_IO_ISC_6) | \
366 (1UL << IRQ_PEND_IO_ISC_7))
367
368#define IRQ_PEND_MCHK_MASK ((1UL << IRQ_PEND_MCHK_REP) | \
369 (1UL << IRQ_PEND_MCHK_EX))
370
298struct kvm_s390_interrupt_info { 371struct kvm_s390_interrupt_info {
299 struct list_head list; 372 struct list_head list;
300 u64 type; 373 u64 type;
@@ -313,6 +386,16 @@ struct kvm_s390_interrupt_info {
313#define ACTION_STORE_ON_STOP (1<<0) 386#define ACTION_STORE_ON_STOP (1<<0)
314#define ACTION_STOP_ON_STOP (1<<1) 387#define ACTION_STOP_ON_STOP (1<<1)
315 388
389struct kvm_s390_irq_payload {
390 struct kvm_s390_io_info io;
391 struct kvm_s390_ext_info ext;
392 struct kvm_s390_pgm_info pgm;
393 struct kvm_s390_emerg_info emerg;
394 struct kvm_s390_extcall_info extcall;
395 struct kvm_s390_prefix_info prefix;
396 struct kvm_s390_mchk_info mchk;
397};
398
316struct kvm_s390_local_interrupt { 399struct kvm_s390_local_interrupt {
317 spinlock_t lock; 400 spinlock_t lock;
318 struct list_head list; 401 struct list_head list;
@@ -321,6 +404,9 @@ struct kvm_s390_local_interrupt {
321 wait_queue_head_t *wq; 404 wait_queue_head_t *wq;
322 atomic_t *cpuflags; 405 atomic_t *cpuflags;
323 unsigned int action_bits; 406 unsigned int action_bits;
407 DECLARE_BITMAP(sigp_emerg_pending, KVM_MAX_VCPUS);
408 struct kvm_s390_irq_payload irq;
409 unsigned long pending_irqs;
324}; 410};
325 411
326struct kvm_s390_float_interrupt { 412struct kvm_s390_float_interrupt {