Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bcd3bb63 authored by Paul Mackerras's avatar Paul Mackerras
Browse files

KVM: PPC: Book3S HV: Disable HPT resizing on POWER9 for now



The new HPT resizing code added in commit b5baa687 ("KVM: PPC:
Book3S HV: KVM-HV HPT resizing implementation", 2016-12-20) doesn't
have code to handle the new HPTE format which POWER9 uses.  Thus it
would be best not to advertise it to userspace on POWER9 systems
until it works properly.

Also, since resize_hpt_rehash_hpte() contains BUG_ON() calls that
could be hit on POWER9, let's prevent it from being called on POWER9
for now.

Acked-by: default avatarDavid Gibson <david@gibson.dropbear.id.au>
Signed-off-by: default avatarPaul Mackerras <paulus@ozlabs.org>
parent 3a4f1760
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -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)
+2 −1
Original line number Original line Diff line number Diff line
@@ -613,7 +613,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: