From: Radim Krčmář Date: Fri, 9 Feb 2018 20:36:57 +0000 (+0100) Subject: Merge tag 'kvm-ppc-next-4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git... X-Git-Tag: v5.4.17~6610^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=1ab03c072feb579c9fd116de25be2b211e6bff6a;p=arm%2Flinux.git Merge tag 'kvm-ppc-next-4.16-2' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc Second PPC KVM update for 4.16 Seven fixes that are either trivial or that address bugs that people are actually hitting. The main ones are: - Drop spinlocks before reading guest memory - Fix a bug causing corruption of VCPU state in PR KVM with preemption enabled - Make HPT resizing work on POWER9 - Add MMIO emulation for vector loads and stores, because guests now use these instructions in memcpy and similar routines. --- 1ab03c072feb579c9fd116de25be2b211e6bff6a diff --cc arch/powerpc/kvm/powerpc.c index 748562ec9a04,47c7a302fd03..403e642c78f5 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@@ -1425,9 -1555,21 +1562,21 @@@ int kvm_arch_vcpu_ioctl_run(struct kvm_ r = kvmppc_emulate_mmio_vsx_loadstore(vcpu, run); if (r == RESUME_HOST) { vcpu->mmio_needed = 1; - return r; + goto out; } } + #endif + #ifdef CONFIG_ALTIVEC + if (vcpu->arch.mmio_vmx_copy_nums > 0) + vcpu->arch.mmio_vmx_copy_nums--; + + if (vcpu->arch.mmio_vmx_copy_nums > 0) { + r = kvmppc_emulate_mmio_vmx_loadstore(vcpu, run); + if (r == RESUME_HOST) { + vcpu->mmio_needed = 1; - return r; ++ goto out; + } + } #endif } else if (vcpu->arch.osi_needed) { u64 *gprs = run->osi.gprs;