diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-18 19:05:28 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-18 19:05:28 -0500 |
| commit | 66dcff86ba40eebb5133cccf450878f2bba102ef (patch) | |
| tree | e7eb49ad9316989a529b00303d2dd2cffa61a7f5 /arch/s390/include/asm | |
| parent | 91ed9e8a32d9a76adc59c83f8b40024076cf8a02 (diff) | |
| parent | 2c4aa55a6af070262cca425745e8e54310e96b8d (diff) | |
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull KVM update from Paolo Bonzini:
"3.19 changes for KVM:
- spring cleaning: removed support for IA64, and for hardware-
assisted virtualization on the PPC970
- ARM, PPC, s390 all had only small fixes
For x86:
- small performance improvements (though only on weird guests)
- usual round of hardware-compliancy fixes from Nadav
- APICv fixes
- XSAVES support for hosts and guests. XSAVES hosts were broken
because the (non-KVM) XSAVES patches inadvertently changed the KVM
userspace ABI whenever XSAVES was enabled; hence, this part is
going to stable. Guest support is just a matter of exposing the
feature and CPUID leaves support"
* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (179 commits)
KVM: move APIC types to arch/x86/
KVM: PPC: Book3S: Enable in-kernel XICS emulation by default
KVM: PPC: Book3S HV: Improve H_CONFER implementation
KVM: PPC: Book3S HV: Fix endianness of instruction obtained from HEIR register
KVM: PPC: Book3S HV: Remove code for PPC970 processors
KVM: PPC: Book3S HV: Tracepoints for KVM HV guest interactions
KVM: PPC: Book3S HV: Simplify locking around stolen time calculations
arch: powerpc: kvm: book3s_paired_singles.c: Remove unused function
arch: powerpc: kvm: book3s_pr.c: Remove unused function
arch: powerpc: kvm: book3s.c: Remove some unused functions
arch: powerpc: kvm: book3s_32_mmu.c: Remove unused function
KVM: PPC: Book3S HV: Check wait conditions before sleeping in kvmppc_vcore_blocked
KVM: PPC: Book3S HV: ptes are big endian
KVM: PPC: Book3S HV: Fix inaccuracies in ICP emulation for H_IPI
KVM: PPC: Book3S HV: Fix KSM memory corruption
KVM: PPC: Book3S HV: Fix an issue where guest is paused on receiving HMI
KVM: PPC: Book3S HV: Fix computation of tlbie operand
KVM: PPC: Book3S HV: Add missing HPTE unlock
KVM: PPC: BookE: Improve irq inject tracepoint
arm/arm64: KVM: Require in-kernel vgic for the arch timers
...
Diffstat (limited to 'arch/s390/include/asm')
| -rw-r--r-- | arch/s390/include/asm/kvm_host.h | 99 | ||||
| -rw-r--r-- | arch/s390/include/asm/pgalloc.h | 1 | ||||
| -rw-r--r-- | arch/s390/include/asm/sigp.h | 1 |
3 files changed, 98 insertions, 3 deletions
diff --git a/arch/s390/include/asm/kvm_host.h b/arch/s390/include/asm/kvm_host.h index 2175f911a73a..9cba74d5d853 100644 --- a/arch/s390/include/asm/kvm_host.h +++ b/arch/s390/include/asm/kvm_host.h | |||
| @@ -123,7 +123,7 @@ struct kvm_s390_sie_block { | |||
| 123 | #define ICPT_PARTEXEC 0x38 | 123 | #define ICPT_PARTEXEC 0x38 |
| 124 | #define ICPT_IOINST 0x40 | 124 | #define ICPT_IOINST 0x40 |
| 125 | __u8 icptcode; /* 0x0050 */ | 125 | __u8 icptcode; /* 0x0050 */ |
| 126 | __u8 reserved51; /* 0x0051 */ | 126 | __u8 icptstatus; /* 0x0051 */ |
| 127 | __u16 ihcpu; /* 0x0052 */ | 127 | __u16 ihcpu; /* 0x0052 */ |
| 128 | __u8 reserved54[2]; /* 0x0054 */ | 128 | __u8 reserved54[2]; /* 0x0054 */ |
| 129 | __u16 ipa; /* 0x0056 */ | 129 | __u16 ipa; /* 0x0056 */ |
| @@ -226,10 +226,17 @@ struct kvm_vcpu_stat { | |||
| 226 | u32 instruction_sigp_sense_running; | 226 | u32 instruction_sigp_sense_running; |
| 227 | u32 instruction_sigp_external_call; | 227 | u32 instruction_sigp_external_call; |
| 228 | u32 instruction_sigp_emergency; | 228 | u32 instruction_sigp_emergency; |
| 229 | u32 instruction_sigp_cond_emergency; | ||
| 230 | u32 instruction_sigp_start; | ||
| 229 | u32 instruction_sigp_stop; | 231 | u32 instruction_sigp_stop; |
| 232 | u32 instruction_sigp_stop_store_status; | ||
| 233 | u32 instruction_sigp_store_status; | ||
| 230 | u32 instruction_sigp_arch; | 234 | u32 instruction_sigp_arch; |
| 231 | u32 instruction_sigp_prefix; | 235 | u32 instruction_sigp_prefix; |
| 232 | u32 instruction_sigp_restart; | 236 | u32 instruction_sigp_restart; |
| 237 | u32 instruction_sigp_init_cpu_reset; | ||
| 238 | u32 instruction_sigp_cpu_reset; | ||
| 239 | u32 instruction_sigp_unknown; | ||
| 233 | u32 diagnose_10; | 240 | u32 diagnose_10; |
| 234 | u32 diagnose_44; | 241 | u32 diagnose_44; |
| 235 | u32 diagnose_9c; | 242 | u32 diagnose_9c; |
| @@ -288,6 +295,79 @@ struct kvm_vcpu_stat { | |||
| 288 | #define PGM_PER 0x80 | 295 | #define PGM_PER 0x80 |
| 289 | #define PGM_CRYPTO_OPERATION 0x119 | 296 | #define PGM_CRYPTO_OPERATION 0x119 |
| 290 | 297 | ||
| 298 | /* irq types in order of priority */ | ||
| 299 | enum 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 | |||
| 291 | struct kvm_s390_interrupt_info { | 371 | struct kvm_s390_interrupt_info { |
| 292 | struct list_head list; | 372 | struct list_head list; |
| 293 | u64 type; | 373 | u64 type; |
| @@ -306,14 +386,25 @@ struct kvm_s390_interrupt_info { | |||
| 306 | #define ACTION_STORE_ON_STOP (1<<0) | 386 | #define ACTION_STORE_ON_STOP (1<<0) |
| 307 | #define ACTION_STOP_ON_STOP (1<<1) | 387 | #define ACTION_STOP_ON_STOP (1<<1) |
| 308 | 388 | ||
| 389 | struct 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 | |||
| 309 | struct kvm_s390_local_interrupt { | 399 | struct kvm_s390_local_interrupt { |
| 310 | spinlock_t lock; | 400 | spinlock_t lock; |
| 311 | struct list_head list; | ||
| 312 | atomic_t active; | ||
| 313 | struct kvm_s390_float_interrupt *float_int; | 401 | struct kvm_s390_float_interrupt *float_int; |
| 314 | wait_queue_head_t *wq; | 402 | wait_queue_head_t *wq; |
| 315 | atomic_t *cpuflags; | 403 | atomic_t *cpuflags; |
| 316 | unsigned int action_bits; | 404 | unsigned int action_bits; |
| 405 | DECLARE_BITMAP(sigp_emerg_pending, KVM_MAX_VCPUS); | ||
| 406 | struct kvm_s390_irq_payload irq; | ||
| 407 | unsigned long pending_irqs; | ||
| 317 | }; | 408 | }; |
| 318 | 409 | ||
| 319 | struct kvm_s390_float_interrupt { | 410 | struct kvm_s390_float_interrupt { |
| @@ -434,6 +525,8 @@ struct kvm_arch{ | |||
| 434 | int user_cpu_state_ctrl; | 525 | int user_cpu_state_ctrl; |
| 435 | struct s390_io_adapter *adapters[MAX_S390_IO_ADAPTERS]; | 526 | struct s390_io_adapter *adapters[MAX_S390_IO_ADAPTERS]; |
| 436 | wait_queue_head_t ipte_wq; | 527 | wait_queue_head_t ipte_wq; |
| 528 | int ipte_lock_count; | ||
| 529 | struct mutex ipte_mutex; | ||
| 437 | spinlock_t start_stop_lock; | 530 | spinlock_t start_stop_lock; |
| 438 | struct kvm_s390_crypto crypto; | 531 | struct kvm_s390_crypto crypto; |
| 439 | }; | 532 | }; |
diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h index e510b9460efa..3009c2ba46d2 100644 --- a/arch/s390/include/asm/pgalloc.h +++ b/arch/s390/include/asm/pgalloc.h | |||
| @@ -24,6 +24,7 @@ void page_table_free_rcu(struct mmu_gather *, unsigned long *, unsigned long); | |||
| 24 | 24 | ||
| 25 | int set_guest_storage_key(struct mm_struct *mm, unsigned long addr, | 25 | int set_guest_storage_key(struct mm_struct *mm, unsigned long addr, |
| 26 | unsigned long key, bool nq); | 26 | unsigned long key, bool nq); |
| 27 | unsigned long get_guest_storage_key(struct mm_struct *mm, unsigned long addr); | ||
| 27 | 28 | ||
| 28 | static inline void clear_table(unsigned long *s, unsigned long val, size_t n) | 29 | static inline void clear_table(unsigned long *s, unsigned long val, size_t n) |
