diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-16 16:00:24 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-11-16 16:00:24 -0500 |
| commit | 974aa5630b318938273d7efe7a2cf031c7b927db (patch) | |
| tree | b79803c07b9c16d87058ce69f80ebe173cdfd838 /arch/arm/include | |
| parent | 441692aafc1731087bbaf657a8b6059d95c2a6df (diff) | |
| parent | a6014f1ab7088dc02b58991cfb6b32a34afdbf12 (diff) | |
Merge tag 'kvm-4.15-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull KVM updates from Radim Krčmář:
"First batch of KVM changes for 4.15
Common:
- Python 3 support in kvm_stat
- Accounting of slabs to kmemcg
ARM:
- Optimized arch timer handling for KVM/ARM
- Improvements to the VGIC ITS code and introduction of an ITS reset
ioctl
- Unification of the 32-bit fault injection logic
- More exact external abort matching logic
PPC:
- Support for running hashed page table (HPT) MMU mode on a host that
is using the radix MMU mode; single threaded mode on POWER 9 is
added as a pre-requisite
- Resolution of merge conflicts with the last second 4.14 HPT fixes
- Fixes and cleanups
s390:
- Some initial preparation patches for exitless interrupts and crypto
- New capability for AIS migration
- Fixes
x86:
- Improved emulation of LAPIC timer mode changes, MCi_STATUS MSRs,
and after-reset state
- Refined dependencies for VMX features
- Fixes for nested SMI injection
- A lot of cleanups"
* tag 'kvm-4.15-1' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (89 commits)
KVM: s390: provide a capability for AIS state migration
KVM: s390: clear_io_irq() requests are not expected for adapter interrupts
KVM: s390: abstract conversion between isc and enum irq_types
KVM: s390: vsie: use common code functions for pinning
KVM: s390: SIE considerations for AP Queue virtualization
KVM: s390: document memory ordering for kvm_s390_vcpu_wakeup
KVM: PPC: Book3S HV: Cosmetic post-merge cleanups
KVM: arm/arm64: fix the incompatible matching for external abort
KVM: arm/arm64: Unify 32bit fault injection
KVM: arm/arm64: vgic-its: Implement KVM_DEV_ARM_ITS_CTRL_RESET
KVM: arm/arm64: Document KVM_DEV_ARM_ITS_CTRL_RESET
KVM: arm/arm64: vgic-its: Free caches when GITS_BASER Valid bit is cleared
KVM: arm/arm64: vgic-its: New helper functions to free the caches
KVM: arm/arm64: vgic-its: Remove kvm_its_unmap_device
arm/arm64: KVM: Load the timer state when enabling the timer
KVM: arm/arm64: Rework kvm_timer_should_fire
KVM: arm/arm64: Get rid of kvm_timer_flush_hwstate
KVM: arm/arm64: Avoid phys timer emulation in vcpu entry/exit
KVM: arm/arm64: Move phys_timer_emulate function
KVM: arm/arm64: Use kvm_arm_timer_set/get_reg for guest register traps
...
Diffstat (limited to 'arch/arm/include')
| -rw-r--r-- | arch/arm/include/asm/kvm_asm.h | 2 | ||||
| -rw-r--r-- | arch/arm/include/asm/kvm_emulate.h | 38 | ||||
| -rw-r--r-- | arch/arm/include/asm/kvm_hyp.h | 4 | ||||
| -rw-r--r-- | arch/arm/include/uapi/asm/kvm.h | 7 |
4 files changed, 45 insertions, 6 deletions
diff --git a/arch/arm/include/asm/kvm_asm.h b/arch/arm/include/asm/kvm_asm.h index 14d68a4d826f..36dd2962a42d 100644 --- a/arch/arm/include/asm/kvm_asm.h +++ b/arch/arm/include/asm/kvm_asm.h | |||
| @@ -68,6 +68,8 @@ extern void __kvm_tlb_flush_vmid_ipa(struct kvm *kvm, phys_addr_t ipa); | |||
| 68 | extern void __kvm_tlb_flush_vmid(struct kvm *kvm); | 68 | extern void __kvm_tlb_flush_vmid(struct kvm *kvm); |
| 69 | extern void __kvm_tlb_flush_local_vmid(struct kvm_vcpu *vcpu); | 69 | extern void __kvm_tlb_flush_local_vmid(struct kvm_vcpu *vcpu); |
| 70 | 70 | ||
| 71 | extern void __kvm_timer_set_cntvoff(u32 cntvoff_low, u32 cntvoff_high); | ||
| 72 | |||
| 71 | extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu); | 73 | extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu); |
| 72 | 74 | ||
| 73 | extern void __init_stage2_translation(void); | 75 | extern void __init_stage2_translation(void); |
diff --git a/arch/arm/include/asm/kvm_emulate.h b/arch/arm/include/asm/kvm_emulate.h index 98089ffd91bb..3d22eb87f919 100644 --- a/arch/arm/include/asm/kvm_emulate.h +++ b/arch/arm/include/asm/kvm_emulate.h | |||
| @@ -25,7 +25,22 @@ | |||
| 25 | #include <asm/kvm_arm.h> | 25 | #include <asm/kvm_arm.h> |
| 26 | #include <asm/cputype.h> | 26 | #include <asm/cputype.h> |
| 27 | 27 | ||
| 28 | /* arm64 compatibility macros */ | ||
| 29 | #define COMPAT_PSR_MODE_ABT ABT_MODE | ||
| 30 | #define COMPAT_PSR_MODE_UND UND_MODE | ||
| 31 | #define COMPAT_PSR_T_BIT PSR_T_BIT | ||
| 32 | #define COMPAT_PSR_I_BIT PSR_I_BIT | ||
| 33 | #define COMPAT_PSR_A_BIT PSR_A_BIT | ||
| 34 | #define COMPAT_PSR_E_BIT PSR_E_BIT | ||
| 35 | #define COMPAT_PSR_IT_MASK PSR_IT_MASK | ||
| 36 | |||
| 28 | unsigned long *vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num); | 37 | unsigned long *vcpu_reg(struct kvm_vcpu *vcpu, u8 reg_num); |
| 38 | |||
| 39 | static inline unsigned long *vcpu_reg32(struct kvm_vcpu *vcpu, u8 reg_num) | ||
| 40 | { | ||
| 41 | return vcpu_reg(vcpu, reg_num); | ||
| 42 | } | ||
| 43 | |||
| 29 | unsigned long *vcpu_spsr(struct kvm_vcpu *vcpu); | 44 | unsigned long *vcpu_spsr(struct kvm_vcpu *vcpu); |
| 30 | 45 | ||
| 31 | static inline unsigned long vcpu_get_reg(struct kvm_vcpu *vcpu, | 46 | static inline unsigned long vcpu_get_reg(struct kvm_vcpu *vcpu, |
| @@ -42,10 +57,25 @@ static inline void vcpu_set_reg(struct kvm_vcpu *vcpu, u8 reg_num, | |||
| 42 | 57 | ||
| 43 | bool kvm_condition_valid32(const struct kvm_vcpu *vcpu); | 58 | bool kvm_condition_valid32(const struct kvm_vcpu *vcpu); |
| 44 | void kvm_skip_instr32(struct kvm_vcpu *vcpu, bool is_wide_instr); | 59 | void kvm_skip_instr32(struct kvm_vcpu *vcpu, bool is_wide_instr); |
| 45 | void kvm_inject_undefined(struct kvm_vcpu *vcpu); | 60 | void kvm_inject_undef32(struct kvm_vcpu *vcpu); |
| 61 | void kvm_inject_dabt32(struct kvm_vcpu *vcpu, unsigned long addr); | ||
| 62 | void kvm_inject_pabt32(struct kvm_vcpu *vcpu, unsigned long addr); | ||
| 46 | void kvm_inject_vabt(struct kvm_vcpu *vcpu); | 63 | void kvm_inject_vabt(struct kvm_vcpu *vcpu); |
| 47 | void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr); | 64 | |
| 48 | void kvm_inject_pabt(struct kvm_vcpu *vcpu, unsigned long addr); | 65 | static inline void kvm_inject_undefined(struct kvm_vcpu *vcpu) |
| 66 | { | ||
| 67 | kvm_inject_undef32(vcpu); | ||
| 68 | } | ||
| 69 | |||
| 70 | static inline void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr) | ||
| 71 | { | ||
| 72 | kvm_inject_dabt32(vcpu, addr); | ||
| 73 | } | ||
| 74 | |||
| 75 | static inline void kvm_inject_pabt(struct kvm_vcpu *vcpu, unsigned long addr) | ||
| 76 | { | ||
| 77 | kvm_inject_pabt32(vcpu, addr); | ||
| 78 | } | ||
| 49 | 79 | ||
| 50 | static inline bool kvm_condition_valid(const struct kvm_vcpu *vcpu) | 80 | static inline bool kvm_condition_valid(const struct kvm_vcpu *vcpu) |
| 51 | { | 81 | { |
| @@ -203,7 +233,7 @@ static inline u8 kvm_vcpu_trap_get_fault_type(struct kvm_vcpu *vcpu) | |||
| 203 | 233 | ||
| 204 | static inline bool kvm_vcpu_dabt_isextabt(struct kvm_vcpu *vcpu) | 234 | static inline bool kvm_vcpu_dabt_isextabt(struct kvm_vcpu *vcpu) |
| 205 | { | 235 | { |
| 206 | switch (kvm_vcpu_trap_get_fault_type(vcpu)) { | 236 | switch (kvm_vcpu_trap_get_fault(vcpu)) { |
| 207 | case FSC_SEA: | 237 | case FSC_SEA: |
| 208 | case FSC_SEA_TTW0: | 238 | case FSC_SEA_TTW0: |
| 209 | case FSC_SEA_TTW1: | 239 | case FSC_SEA_TTW1: |
diff --git a/arch/arm/include/asm/kvm_hyp.h b/arch/arm/include/asm/kvm_hyp.h index 14b5903f0224..ab20ffa8b9e7 100644 --- a/arch/arm/include/asm/kvm_hyp.h +++ b/arch/arm/include/asm/kvm_hyp.h | |||
| @@ -98,8 +98,8 @@ | |||
| 98 | #define cntvoff_el2 CNTVOFF | 98 | #define cntvoff_el2 CNTVOFF |
| 99 | #define cnthctl_el2 CNTHCTL | 99 | #define cnthctl_el2 CNTHCTL |
| 100 | 100 | ||
| 101 | void __timer_save_state(struct kvm_vcpu *vcpu); | 101 | void __timer_enable_traps(struct kvm_vcpu *vcpu); |
| 102 | void __timer_restore_state(struct kvm_vcpu *vcpu); | 102 | void __timer_disable_traps(struct kvm_vcpu *vcpu); |
| 103 | 103 | ||
| 104 | void __vgic_v2_save_state(struct kvm_vcpu *vcpu); | 104 | void __vgic_v2_save_state(struct kvm_vcpu *vcpu); |
| 105 | void __vgic_v2_restore_state(struct kvm_vcpu *vcpu); | 105 | void __vgic_v2_restore_state(struct kvm_vcpu *vcpu); |
diff --git a/arch/arm/include/uapi/asm/kvm.h b/arch/arm/include/uapi/asm/kvm.h index 1f57bbe82b6f..6edd177bb1c7 100644 --- a/arch/arm/include/uapi/asm/kvm.h +++ b/arch/arm/include/uapi/asm/kvm.h | |||
| @@ -152,6 +152,12 @@ struct kvm_arch_memory_slot { | |||
| 152 | (__ARM_CP15_REG(op1, 0, crm, 0) | KVM_REG_SIZE_U64) | 152 | (__ARM_CP15_REG(op1, 0, crm, 0) | KVM_REG_SIZE_U64) |
| 153 | #define ARM_CP15_REG64(...) __ARM_CP15_REG64(__VA_ARGS__) | 153 | #define ARM_CP15_REG64(...) __ARM_CP15_REG64(__VA_ARGS__) |
| 154 | 154 | ||
| 155 | /* PL1 Physical Timer Registers */ | ||
| 156 | #define KVM_REG_ARM_PTIMER_CTL ARM_CP15_REG32(0, 14, 2, 1) | ||
| 157 | #define KVM_REG_ARM_PTIMER_CNT ARM_CP15_REG64(0, 14) | ||
| 158 | #define KVM_REG_ARM_PTIMER_CVAL ARM_CP15_REG64(2, 14) | ||
| 159 | |||
| 160 | /* Virtual Timer Registers */ | ||
| 155 | #define KVM_REG_ARM_TIMER_CTL ARM_CP15_REG32(0, 14, 3, 1) | 161 | #define KVM_REG_ARM_TIMER_CTL ARM_CP15_REG32(0, 14, 3, 1) |
| 156 | #define KVM_REG_ARM_TIMER_CNT ARM_CP15_REG64(1, 14) | 162 | #define KVM_REG_ARM_TIMER_CNT ARM_CP15_REG64(1, 14) |
| 157 | #define KVM_REG_ARM_TIMER_CVAL ARM_CP15_REG64(3, 14) | 163 | #define KVM_REG_ARM_TIMER_CVAL ARM_CP15_REG64(3, 14) |
| @@ -216,6 +222,7 @@ struct kvm_arch_memory_slot { | |||
| 216 | #define KVM_DEV_ARM_ITS_SAVE_TABLES 1 | 222 | #define KVM_DEV_ARM_ITS_SAVE_TABLES 1 |
| 217 | #define KVM_DEV_ARM_ITS_RESTORE_TABLES 2 | 223 | #define KVM_DEV_ARM_ITS_RESTORE_TABLES 2 |
| 218 | #define KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES 3 | 224 | #define KVM_DEV_ARM_VGIC_SAVE_PENDING_TABLES 3 |
| 225 | #define KVM_DEV_ARM_ITS_CTRL_RESET 4 | ||
| 219 | 226 | ||
| 220 | /* KVM_IRQ_LINE irq field index values */ | 227 | /* KVM_IRQ_LINE irq field index values */ |
| 221 | #define KVM_ARM_IRQ_TYPE_SHIFT 24 | 228 | #define KVM_ARM_IRQ_TYPE_SHIFT 24 |
