diff --git a/arch/powerpc/kvm/44x.c b/arch/powerpc/kvm/44x.c
index f07615d..8d24c31 100644
--- a/arch/powerpc/kvm/44x.c
+++ b/arch/powerpc/kvm/44x.c
@@ -36,8 +36,29 @@ static struct kvm_powerpc_ops 44x_powerpc_ops = {
 static void booke_44x_init(void)
 {
 	int r;
+	unsigned long ivor[16];
 
-	r = kvmppc_booke_init();
+	/* Copy our interrupt handlers to match host IVORs. That way we don't
+	 * have to swap the IVORs on every guest/host transition. */
+	memset(ivor, 0xFF, sizeof(ivor));
+	ivor[0] = mfspr(SPRN_IVOR0);
+	ivor[1] = mfspr(SPRN_IVOR1);
+	ivor[2] = mfspr(SPRN_IVOR2);
+	ivor[3] = mfspr(SPRN_IVOR3);
+	ivor[4] = mfspr(SPRN_IVOR4);
+	ivor[5] = mfspr(SPRN_IVOR5);
+	ivor[6] = mfspr(SPRN_IVOR6);
+	ivor[7] = mfspr(SPRN_IVOR7);
+	ivor[8] = mfspr(SPRN_IVOR8);
+	ivor[9] = mfspr(SPRN_IVOR9);
+	ivor[10] = mfspr(SPRN_IVOR10);
+	ivor[11] = mfspr(SPRN_IVOR11);
+	ivor[12] = mfspr(SPRN_IVOR12);
+	ivor[13] = mfspr(SPRN_IVOR13);
+	ivor[14] = mfspr(SPRN_IVOR14);
+	ivor[15] = mfspr(SPRN_IVOR15);
+
+	r = kvmppc_booke_init(ivor, 16);
 	if (r)
 		return r;
 
diff --git a/arch/powerpc/kvm/booke_host.c b/arch/powerpc/kvm/booke_host.c
index 26ef44f..388be9d 100644
--- a/arch/powerpc/kvm/booke_host.c
+++ b/arch/powerpc/kvm/booke_host.c
@@ -24,11 +24,10 @@
 
 unsigned long kvmppc_booke_handlers;
 
-int kvmppc_booke_init(void)
+int kvmppc_booke_init(unsigned long *ivor, int num)
 {
-	unsigned long ivor[16];
 	unsigned long max_ivor = 0;
-	int i;
+	int i, valid_ivor;
 
 	/* We install our own exception handlers by hijacking IVPR. IVPR must
 	 * be 16-bit aligned, so we need a 64KB allocation. */
@@ -39,32 +38,17 @@ int kvmppc_booke_init(void)
 
 	/* XXX make sure our handlers are smaller than Linux's */
 
-	/* Copy our interrupt handlers to match host IVORs. That way we don't
-	 * have to swap the IVORs on every guest/host transition. */
-	ivor[0] = mfspr(SPRN_IVOR0);
-	ivor[1] = mfspr(SPRN_IVOR1);
-	ivor[2] = mfspr(SPRN_IVOR2);
-	ivor[3] = mfspr(SPRN_IVOR3);
-	ivor[4] = mfspr(SPRN_IVOR4);
-	ivor[5] = mfspr(SPRN_IVOR5);
-	ivor[6] = mfspr(SPRN_IVOR6);
-	ivor[7] = mfspr(SPRN_IVOR7);
-	ivor[8] = mfspr(SPRN_IVOR8);
-	ivor[9] = mfspr(SPRN_IVOR9);
-	ivor[10] = mfspr(SPRN_IVOR10);
-	ivor[11] = mfspr(SPRN_IVOR11);
-	ivor[12] = mfspr(SPRN_IVOR12);
-	ivor[13] = mfspr(SPRN_IVOR13);
-	ivor[14] = mfspr(SPRN_IVOR14);
-	ivor[15] = mfspr(SPRN_IVOR15);
-
-	for (i = 0; i < 16; i++) {
-		if (ivor[i] > max_ivor)
-			max_ivor = ivor[i];
-
-		memcpy((void *)kvmppc_booke_handlers + ivor[i],
-		       kvmppc_handlers_start + i * kvmppc_handler_len,
-		       kvmppc_handler_len);
+	for (i = 0, valid_ivor = 0; i < num; i++) {
+		/* skip hole in ivor[] */
+		if (ivor[i] != ~0UL) {
+			if (ivor[i] > max_ivor)
+				max_ivor = ivor[i];
+			memcpy((void *)kvmppc_booke_handlers + ivor[i],
+				kvmppc_handlers_start +
+				valid_ivor * kvmppc_handler_len,
+				kvmppc_handler_len);
+			valid_ivor++;
+		}
 	}
 	flush_icache_range(kvmppc_booke_handlers,
 	                   kvmppc_booke_handlers + max_ivor + kvmppc_handler_len);
