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/arm64 | |
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/arm64')
-rw-r--r-- | arch/arm64/include/asm/kvm_emulate.h | 5 | ||||
-rw-r--r-- | arch/arm64/include/asm/kvm_host.h | 3 | ||||
-rw-r--r-- | arch/arm64/include/asm/kvm_mmu.h | 6 | ||||
-rw-r--r-- | arch/arm64/kvm/guest.c | 26 |
4 files changed, 10 insertions, 30 deletions
diff --git a/arch/arm64/include/asm/kvm_emulate.h b/arch/arm64/include/asm/kvm_emulate.h index 5674a55b5518..8127e45e2637 100644 --- a/arch/arm64/include/asm/kvm_emulate.h +++ b/arch/arm64/include/asm/kvm_emulate.h | |||
@@ -38,6 +38,11 @@ void kvm_inject_undefined(struct kvm_vcpu *vcpu); | |||
38 | void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr); | 38 | void kvm_inject_dabt(struct kvm_vcpu *vcpu, unsigned long addr); |
39 | void kvm_inject_pabt(struct kvm_vcpu *vcpu, unsigned long addr); | 39 | void kvm_inject_pabt(struct kvm_vcpu *vcpu, unsigned long addr); |
40 | 40 | ||
41 | static inline void vcpu_reset_hcr(struct kvm_vcpu *vcpu) | ||
42 | { | ||
43 | vcpu->arch.hcr_el2 = HCR_GUEST_FLAGS; | ||
44 | } | ||
45 | |||
41 | static inline unsigned long *vcpu_pc(const struct kvm_vcpu *vcpu) | 46 | static inline unsigned long *vcpu_pc(const struct kvm_vcpu *vcpu) |
42 | { | 47 | { |
43 | return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.pc; | 48 | return (unsigned long *)&vcpu_gp_regs(vcpu)->regs.pc; |
diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h index 2012c4ba8d67..0b7dfdb931df 100644 --- a/arch/arm64/include/asm/kvm_host.h +++ b/arch/arm64/include/asm/kvm_host.h | |||
@@ -165,8 +165,6 @@ struct kvm_vcpu_stat { | |||
165 | u32 halt_wakeup; | 165 | u32 halt_wakeup; |
166 | }; | 166 | }; |
167 | 167 | ||
168 | int kvm_vcpu_set_target(struct kvm_vcpu *vcpu, | ||
169 | const struct kvm_vcpu_init *init); | ||
170 | int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init); | 168 | int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init); |
171 | unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu); | 169 | unsigned long kvm_arm_num_regs(struct kvm_vcpu *vcpu); |
172 | int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *indices); | 170 | int kvm_arm_copy_reg_indices(struct kvm_vcpu *vcpu, u64 __user *indices); |
@@ -200,6 +198,7 @@ struct kvm_vcpu *kvm_arm_get_running_vcpu(void); | |||
200 | struct kvm_vcpu * __percpu *kvm_get_running_vcpus(void); | 198 | struct kvm_vcpu * __percpu *kvm_get_running_vcpus(void); |
201 | 199 | ||
202 | u64 kvm_call_hyp(void *hypfn, ...); | 200 | u64 kvm_call_hyp(void *hypfn, ...); |
201 | void force_vm_exit(const cpumask_t *mask); | ||
203 | 202 | ||
204 | int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run, | 203 | int handle_exit(struct kvm_vcpu *vcpu, struct kvm_run *run, |
205 | int exception_index); | 204 | int exception_index); |
diff --git a/arch/arm64/include/asm/kvm_mmu.h b/arch/arm64/include/asm/kvm_mmu.h index 0caf7a59f6a1..14a74f136272 100644 --- a/arch/arm64/include/asm/kvm_mmu.h +++ b/arch/arm64/include/asm/kvm_mmu.h | |||
@@ -83,6 +83,7 @@ int create_hyp_io_mappings(void *from, void *to, phys_addr_t); | |||
83 | void free_boot_hyp_pgd(void); | 83 | void free_boot_hyp_pgd(void); |
84 | void free_hyp_pgds(void); | 84 | void free_hyp_pgds(void); |
85 | 85 | ||
86 | void stage2_unmap_vm(struct kvm *kvm); | ||
86 | int kvm_alloc_stage2_pgd(struct kvm *kvm); | 87 | int kvm_alloc_stage2_pgd(struct kvm *kvm); |
87 | void kvm_free_stage2_pgd(struct kvm *kvm); | 88 | void kvm_free_stage2_pgd(struct kvm *kvm); |
88 | int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa, | 89 | int kvm_phys_addr_ioremap(struct kvm *kvm, phys_addr_t guest_ipa, |
@@ -243,9 +244,10 @@ static inline bool vcpu_has_cache_enabled(struct kvm_vcpu *vcpu) | |||
243 | } | 244 | } |
244 | 245 | ||
245 | static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva, | 246 | static inline void coherent_cache_guest_page(struct kvm_vcpu *vcpu, hva_t hva, |
246 | unsigned long size) | 247 | unsigned long size, |
248 | bool ipa_uncached) | ||
247 | { | 249 | { |
248 | if (!vcpu_has_cache_enabled(vcpu)) | 250 | if (!vcpu_has_cache_enabled(vcpu) || ipa_uncached) |
249 | kvm_flush_dcache_to_poc((void *)hva, size); | 251 | kvm_flush_dcache_to_poc((void *)hva, size); |
250 | 252 | ||
251 | if (!icache_is_aliasing()) { /* PIPT */ | 253 | if (!icache_is_aliasing()) { /* PIPT */ |
diff --git a/arch/arm64/kvm/guest.c b/arch/arm64/kvm/guest.c index 76794692c20b..9535bd555d1d 100644 --- a/arch/arm64/kvm/guest.c +++ b/arch/arm64/kvm/guest.c | |||
@@ -38,7 +38,6 @@ struct kvm_stats_debugfs_item debugfs_entries[] = { | |||
38 | 38 | ||
39 | int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) | 39 | int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu) |
40 | { | 40 | { |
41 | vcpu->arch.hcr_el2 = HCR_GUEST_FLAGS; | ||
42 | return 0; | 41 | return 0; |
43 | } | 42 | } |
44 | 43 | ||
@@ -297,31 +296,6 @@ int __attribute_const__ kvm_target_cpu(void) | |||
297 | return -EINVAL; | 296 | return -EINVAL; |
298 | } | 297 | } |
299 | 298 | ||
300 | int kvm_vcpu_set_target(struct kvm_vcpu *vcpu, | ||
301 | const struct kvm_vcpu_init *init) | ||
302 | { | ||
303 | unsigned int i; | ||
304 | int phys_target = kvm_target_cpu(); | ||
305 | |||
306 | if (init->target != phys_target) | ||
307 | return -EINVAL; | ||
308 | |||
309 | vcpu->arch.target = phys_target; | ||
310 | bitmap_zero(vcpu->arch.features, KVM_VCPU_MAX_FEATURES); | ||
311 | |||
312 | /* -ENOENT for unknown features, -EINVAL for invalid combinations. */ | ||
313 | for (i = 0; i < sizeof(init->features) * 8; i++) { | ||
314 | if (init->features[i / 32] & (1 << (i % 32))) { | ||
315 | if (i >= KVM_VCPU_MAX_FEATURES) | ||
316 | return -ENOENT; | ||
317 | set_bit(i, vcpu->arch.features); | ||
318 | } | ||
319 | } | ||
320 | |||
321 | /* Now we know what it is, we can reset it. */ | ||
322 | return kvm_reset_vcpu(vcpu); | ||
323 | } | ||
324 | |||
325 | int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init) | 299 | int kvm_vcpu_preferred_target(struct kvm_vcpu_init *init) |
326 | { | 300 | { |
327 | int target = kvm_target_cpu(); | 301 | int target = kvm_target_cpu(); |