aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-09-12 17:30:14 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-09-12 17:30:14 -0400
commitac059c4fa78ff548ad7b2ecbad491e46bfbc6d2d (patch)
treee8a2bcc9c4caaff900ce9cf5a18f11b7a7e4b305
parent2c937eb4ddca946bb74936cf63aba0f94aa0efb3 (diff)
parent27bd44e06cf4e6c51b985810e7c56147bc8d94d5 (diff)
Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm
Pull KVM fixes from Paolo Bonzini: - s390: nested virt fixes (new 4.8 feature) - x86: fixes for 4.8 regressions - ARM: two small bugfixes * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: kvm-arm: Unmap shadow pagetables properly x86, clock: Fix kvm guest tsc initialization arm: KVM: Fix idmap overlap detection when the kernel is idmap'ed KVM: lapic: adjust preemption timer correctly when goes TSC backward KVM: s390: vsie: fix riccbd KVM: s390: don't use current->thread.fpu.* when accessing registers
-rw-r--r--arch/arm/kvm/arm.c2
-rw-r--r--arch/arm/kvm/mmu.c4
-rw-r--r--arch/s390/kvm/kvm-s390.c10
-rw-r--r--arch/s390/kvm/vsie.c2
-rw-r--r--arch/x86/kernel/kvmclock.c1
-rw-r--r--arch/x86/kvm/x86.c8
6 files changed, 15 insertions, 12 deletions
diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
index 75f130ef6504..c94b90d43772 100644
--- a/arch/arm/kvm/arm.c
+++ b/arch/arm/kvm/arm.c
@@ -158,8 +158,6 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
158{ 158{
159 int i; 159 int i;
160 160
161 kvm_free_stage2_pgd(kvm);
162
163 for (i = 0; i < KVM_MAX_VCPUS; ++i) { 161 for (i = 0; i < KVM_MAX_VCPUS; ++i) {
164 if (kvm->vcpus[i]) { 162 if (kvm->vcpus[i]) {
165 kvm_arch_vcpu_free(kvm->vcpus[i]); 163 kvm_arch_vcpu_free(kvm->vcpus[i]);
diff --git a/arch/arm/kvm/mmu.c b/arch/arm/kvm/mmu.c
index 29d0b23af2a9..e9a5c0e0c115 100644
--- a/arch/arm/kvm/mmu.c
+++ b/arch/arm/kvm/mmu.c
@@ -1714,7 +1714,8 @@ int kvm_mmu_init(void)
1714 kern_hyp_va(PAGE_OFFSET), kern_hyp_va(~0UL)); 1714 kern_hyp_va(PAGE_OFFSET), kern_hyp_va(~0UL));
1715 1715
1716 if (hyp_idmap_start >= kern_hyp_va(PAGE_OFFSET) && 1716 if (hyp_idmap_start >= kern_hyp_va(PAGE_OFFSET) &&
1717 hyp_idmap_start < kern_hyp_va(~0UL)) { 1717 hyp_idmap_start < kern_hyp_va(~0UL) &&
1718 hyp_idmap_start != (unsigned long)__hyp_idmap_text_start) {
1718 /* 1719 /*
1719 * The idmap page is intersecting with the VA space, 1720 * The idmap page is intersecting with the VA space,
1720 * it is not safe to continue further. 1721 * it is not safe to continue further.
@@ -1893,6 +1894,7 @@ void kvm_arch_memslots_updated(struct kvm *kvm, struct kvm_memslots *slots)
1893 1894
1894void kvm_arch_flush_shadow_all(struct kvm *kvm) 1895void kvm_arch_flush_shadow_all(struct kvm *kvm)
1895{ 1896{
1897 kvm_free_stage2_pgd(kvm);
1896} 1898}
1897 1899
1898void kvm_arch_flush_shadow_memslot(struct kvm *kvm, 1900void kvm_arch_flush_shadow_memslot(struct kvm *kvm,
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index f142215ed30d..607ec91966c7 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -2231,9 +2231,10 @@ int kvm_arch_vcpu_ioctl_set_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
2231 return -EINVAL; 2231 return -EINVAL;
2232 current->thread.fpu.fpc = fpu->fpc; 2232 current->thread.fpu.fpc = fpu->fpc;
2233 if (MACHINE_HAS_VX) 2233 if (MACHINE_HAS_VX)
2234 convert_fp_to_vx(current->thread.fpu.vxrs, (freg_t *)fpu->fprs); 2234 convert_fp_to_vx((__vector128 *) vcpu->run->s.regs.vrs,
2235 (freg_t *) fpu->fprs);
2235 else 2236 else
2236 memcpy(current->thread.fpu.fprs, &fpu->fprs, sizeof(fpu->fprs)); 2237 memcpy(vcpu->run->s.regs.fprs, &fpu->fprs, sizeof(fpu->fprs));
2237 return 0; 2238 return 0;
2238} 2239}
2239 2240
@@ -2242,9 +2243,10 @@ int kvm_arch_vcpu_ioctl_get_fpu(struct kvm_vcpu *vcpu, struct kvm_fpu *fpu)
2242 /* make sure we have the latest values */ 2243 /* make sure we have the latest values */
2243 save_fpu_regs(); 2244 save_fpu_regs();
2244 if (MACHINE_HAS_VX) 2245 if (MACHINE_HAS_VX)
2245 convert_vx_to_fp((freg_t *)fpu->fprs, current->thread.fpu.vxrs); 2246 convert_vx_to_fp((freg_t *) fpu->fprs,
2247 (__vector128 *) vcpu->run->s.regs.vrs);
2246 else 2248 else
2247 memcpy(fpu->fprs, current->thread.fpu.fprs, sizeof(fpu->fprs)); 2249 memcpy(fpu->fprs, vcpu->run->s.regs.fprs, sizeof(fpu->fprs));
2248 fpu->fpc = current->thread.fpu.fpc; 2250 fpu->fpc = current->thread.fpu.fpc;
2249 return 0; 2251 return 0;
2250} 2252}
diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
index c106488b4137..d8673e243f13 100644
--- a/arch/s390/kvm/vsie.c
+++ b/arch/s390/kvm/vsie.c
@@ -584,7 +584,7 @@ static int pin_blocks(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
584 /* Validity 0x0044 will be checked by SIE */ 584 /* Validity 0x0044 will be checked by SIE */
585 if (rc) 585 if (rc)
586 goto unpin; 586 goto unpin;
587 scb_s->gvrd = hpa; 587 scb_s->riccbd = hpa;
588 } 588 }
589 return 0; 589 return 0;
590unpin: 590unpin:
diff --git a/arch/x86/kernel/kvmclock.c b/arch/x86/kernel/kvmclock.c
index 1d39bfbd26bb..3692249a70f1 100644
--- a/arch/x86/kernel/kvmclock.c
+++ b/arch/x86/kernel/kvmclock.c
@@ -289,6 +289,7 @@ void __init kvmclock_init(void)
289 put_cpu(); 289 put_cpu();
290 290
291 x86_platform.calibrate_tsc = kvm_get_tsc_khz; 291 x86_platform.calibrate_tsc = kvm_get_tsc_khz;
292 x86_platform.calibrate_cpu = kvm_get_tsc_khz;
292 x86_platform.get_wallclock = kvm_get_wallclock; 293 x86_platform.get_wallclock = kvm_get_wallclock;
293 x86_platform.set_wallclock = kvm_set_wallclock; 294 x86_platform.set_wallclock = kvm_set_wallclock;
294#ifdef CONFIG_X86_LOCAL_APIC 295#ifdef CONFIG_X86_LOCAL_APIC
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 19f9f9e05c2a..699f8726539a 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2743,16 +2743,16 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu)
2743 if (tsc_delta < 0) 2743 if (tsc_delta < 0)
2744 mark_tsc_unstable("KVM discovered backwards TSC"); 2744 mark_tsc_unstable("KVM discovered backwards TSC");
2745 2745
2746 if (kvm_lapic_hv_timer_in_use(vcpu) &&
2747 kvm_x86_ops->set_hv_timer(vcpu,
2748 kvm_get_lapic_tscdeadline_msr(vcpu)))
2749 kvm_lapic_switch_to_sw_timer(vcpu);
2750 if (check_tsc_unstable()) { 2746 if (check_tsc_unstable()) {
2751 u64 offset = kvm_compute_tsc_offset(vcpu, 2747 u64 offset = kvm_compute_tsc_offset(vcpu,
2752 vcpu->arch.last_guest_tsc); 2748 vcpu->arch.last_guest_tsc);
2753 kvm_x86_ops->write_tsc_offset(vcpu, offset); 2749 kvm_x86_ops->write_tsc_offset(vcpu, offset);
2754 vcpu->arch.tsc_catchup = 1; 2750 vcpu->arch.tsc_catchup = 1;
2755 } 2751 }
2752 if (kvm_lapic_hv_timer_in_use(vcpu) &&
2753 kvm_x86_ops->set_hv_timer(vcpu,
2754 kvm_get_lapic_tscdeadline_msr(vcpu)))
2755 kvm_lapic_switch_to_sw_timer(vcpu);
2756 /* 2756 /*
2757 * On a host with synchronized TSC, there is no need to update 2757 * On a host with synchronized TSC, there is no need to update
2758 * kvmclock on vcpu->cpu migration 2758 * kvmclock on vcpu->cpu migration