Commit a26d5534 authored by Paolo Bonzini's avatar Paolo Bonzini

Merge branch 'kvm-ppc-next' of...

Merge branch 'kvm-ppc-next' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc into HEAD

Paul Mackerras writes:
"Please do a pull from my kvm-ppc-next branch to get some fixes which I
would like to have in 4.11.  There are four small commits there; two
are fixes for potential host crashes in the new HPT resizing code, and
the other two are changes to printks to make KVM on PPC a little less
noisy."
parents 843574a3 bcd3bb63
...@@ -224,7 +224,8 @@ static int kvmppc_mmu_book3s_32_xlate_pte(struct kvm_vcpu *vcpu, gva_t eaddr, ...@@ -224,7 +224,8 @@ static int kvmppc_mmu_book3s_32_xlate_pte(struct kvm_vcpu *vcpu, gva_t eaddr,
ptem = kvmppc_mmu_book3s_32_get_ptem(sre, eaddr, primary); ptem = kvmppc_mmu_book3s_32_get_ptem(sre, eaddr, primary);
if(copy_from_user(pteg, (void __user *)ptegp, sizeof(pteg))) { if(copy_from_user(pteg, (void __user *)ptegp, sizeof(pteg))) {
printk(KERN_ERR "KVM: Can't copy data from 0x%lx!\n", ptegp); printk_ratelimited(KERN_ERR
"KVM: Can't copy data from 0x%lx!\n", ptegp);
goto no_page_found; goto no_page_found;
} }
......
...@@ -265,7 +265,8 @@ static int kvmppc_mmu_book3s_64_xlate(struct kvm_vcpu *vcpu, gva_t eaddr, ...@@ -265,7 +265,8 @@ static int kvmppc_mmu_book3s_64_xlate(struct kvm_vcpu *vcpu, gva_t eaddr,
goto no_page_found; goto no_page_found;
if(copy_from_user(pteg, (void __user *)ptegp, sizeof(pteg))) { if(copy_from_user(pteg, (void __user *)ptegp, sizeof(pteg))) {
printk(KERN_ERR "KVM can't copy data from 0x%lx!\n", ptegp); printk_ratelimited(KERN_ERR
"KVM: Can't copy data from 0x%lx!\n", ptegp);
goto no_page_found; goto no_page_found;
} }
......
...@@ -127,8 +127,8 @@ void kvmppc_set_hpt(struct kvm *kvm, struct kvm_hpt_info *info) ...@@ -127,8 +127,8 @@ void kvmppc_set_hpt(struct kvm *kvm, struct kvm_hpt_info *info)
kvm->arch.hpt = *info; kvm->arch.hpt = *info;
kvm->arch.sdr1 = __pa(info->virt) | (info->order - 18); kvm->arch.sdr1 = __pa(info->virt) | (info->order - 18);
pr_info("KVM guest htab at %lx (order %ld), LPID %x\n", pr_debug("KVM guest htab at %lx (order %ld), LPID %x\n",
info->virt, (long)info->order, kvm->arch.lpid); info->virt, (long)info->order, kvm->arch.lpid);
} }
long kvmppc_alloc_reset_hpt(struct kvm *kvm, int order) long kvmppc_alloc_reset_hpt(struct kvm *kvm, int order)
...@@ -1370,6 +1370,12 @@ static int resize_hpt_rehash(struct kvm_resize_hpt *resize) ...@@ -1370,6 +1370,12 @@ static int resize_hpt_rehash(struct kvm_resize_hpt *resize)
unsigned long i; unsigned long i;
int rc; int rc;
/*
* resize_hpt_rehash_hpte() doesn't handle the new-format HPTEs
* that POWER9 uses, and could well hit a BUG_ON on POWER9.
*/
if (cpu_has_feature(CPU_FTR_ARCH_300))
return -EIO;
for (i = 0; i < kvmppc_hpt_npte(&kvm->arch.hpt); i++) { for (i = 0; i < kvmppc_hpt_npte(&kvm->arch.hpt); i++) {
rc = resize_hpt_rehash_hpte(resize, i); rc = resize_hpt_rehash_hpte(resize, i);
if (rc != 0) if (rc != 0)
...@@ -1407,6 +1413,9 @@ static void resize_hpt_release(struct kvm *kvm, struct kvm_resize_hpt *resize) ...@@ -1407,6 +1413,9 @@ static void resize_hpt_release(struct kvm *kvm, struct kvm_resize_hpt *resize)
{ {
BUG_ON(kvm->arch.resize_hpt != resize); BUG_ON(kvm->arch.resize_hpt != resize);
if (!resize)
return;
if (resize->hpt.virt) if (resize->hpt.virt)
kvmppc_free_hpt(&resize->hpt); kvmppc_free_hpt(&resize->hpt);
......
...@@ -614,7 +614,8 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext) ...@@ -614,7 +614,8 @@ int kvm_vm_ioctl_check_extension(struct kvm *kvm, long ext)
r = 1; r = 1;
break; break;
case KVM_CAP_SPAPR_RESIZE_HPT: case KVM_CAP_SPAPR_RESIZE_HPT:
r = !!hv_enabled; /* Disable this on POWER9 until code handles new HPTE format */
r = !!hv_enabled && !cpu_has_feature(CPU_FTR_ARCH_300);
break; break;
#endif #endif
case KVM_CAP_PPC_HTM: case KVM_CAP_PPC_HTM:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment