[PATCH 17/23] Patch SLB size

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We need to loop through the SLB several times when switching from guest to host
or vice versa.

We only really know the SLB size of the system we're running on on bootup.
Linux patches its own assembly code on bootup to know how big its SLB is.

Let's just take that code and patch our own assembly as well, so we can
loop through the SLB easily.

Signed-off-by: Alexander Graf <agraf@xxxxxxx>
---
 arch/powerpc/mm/slb.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c
index 3b52c80..6afd4fe 100644
--- a/arch/powerpc/mm/slb.c
+++ b/arch/powerpc/mm/slb.c
@@ -267,6 +267,12 @@ void slb_initialize(void)
 	extern unsigned int *slb_miss_kernel_load_vmemmap;
 	unsigned long vmemmap_llp;
 #endif
+#ifdef CONFIG_KVM_970_HANDLER
+	extern unsigned int *kvmppc_patch_slb_1;
+	extern unsigned int *kvmppc_patch_slb_2;
+	extern unsigned int *kvmppc_patch_slb_3;
+	extern unsigned int *kvmppc_patch_slb_4;
+#endif
 
 	/* Prepare our SLB miss handler based on our page size */
 	linear_llp = mmu_psize_defs[mmu_linear_psize].sllp;
@@ -293,6 +299,13 @@ void slb_initialize(void)
 				   SLB_VSID_KERNEL | vmemmap_llp);
 		DBG("SLB: vmemmap LLP = %04lx\n", vmemmap_llp);
 #endif
+
+#ifdef CONFIG_KVM_970_HANDLER
+		patch_slb_encoding(kvmppc_patch_slb_1, mmu_slb_size);
+		patch_slb_encoding(kvmppc_patch_slb_2, mmu_slb_size);
+		patch_slb_encoding(kvmppc_patch_slb_3, mmu_slb_size);
+		patch_slb_encoding(kvmppc_patch_slb_4, mmu_slb_size);
+#endif
 	}
 
 	get_paca()->stab_rr = SLB_NUM_BOLTED;
-- 
1.6.0.2

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux