diff --git a/arch/powerpc/kvm/book3s_hv_builtin.c b/arch/powerpc/kvm/book3s_hv_builtin.c
index 0c4633c..2cebd02 100644
--- a/arch/powerpc/kvm/book3s_hv_builtin.c
+++ b/arch/powerpc/kvm/book3s_hv_builtin.c
@@ -431,6 +431,29 @@ static void kvm_release_linear(struct kvmppc_linear_info *ri)
 }
 
 /*
+ * Default to reserving 3% of RAM
+ * (it only gets reserved if HV KVM is possible on this processor).
+ */
+static u64 kvm_memory = 3;
+static int kvm_memory_percent = 1;
+
+static int __init early_parse_kvm_memory(char *p)
+{
+	char *endp;
+
+	if (!p)
+		return 1;
+
+	kvm_memory = memparse(p, &endp);
+	kvm_memory_percent = 0;
+	if (*endp == '%')
+		kvm_memory_percent = 1;
+
+	return 0;
+}
+early_param("kvm_memory", early_parse_kvm_memory);
+
+/*
  * Called at boot time while the bootmem allocator is active,
  * to allocate contiguous physical memory for the hash page
  * tables for guests.
@@ -458,6 +481,23 @@ void __init kvm_linear_init(void)
 		total += kvm_rma_count * kvm_rma_size;
 	}
 
+	/*
+	 * See if an explicit amount or percentage is requested;
+	 * if so treat it as a minimum.
+	 */
+	if (kvm_memory) {
+		u64 memsize = max_pfn << PAGE_SHIFT;
+
+		if (!kvm_memory_percent) {
+			if (kvm_memory < memsize && kvm_memory > total)
+				total = kvm_memory;
+		} else if (kvm_memory < 100) {
+			memsize = (memsize * kvm_memory) / 100;
+			if (memsize > total)
+				total = memsize;
+		}
+	}
+
 	if (!total)
 		return;
 
