Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

KVM: PPC: Replace SPAPR_TCE_SHIFT with IOMMU_PAGE_SHIFT_4K

SPAPR_TCE_SHIFT is used in few places only and since IOMMU_PAGE_SHIFT_4K
can be easily used instead, remove SPAPR_TCE_SHIFT.

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by

Alexey Kardashevskiy and committed by
Paul Mackerras
462ee11e f8626985

+4 -5
-2
arch/powerpc/include/asm/kvm_book3s_64.h
··· 33 33 } 34 34 #endif 35 35 36 - #define SPAPR_TCE_SHIFT 12 37 - 38 36 #ifdef CONFIG_KVM_BOOK3S_HV_POSSIBLE 39 37 #define KVM_DEFAULT_HPT_ORDER 24 /* 16MB HPT by default */ 40 38 #endif
+2 -1
arch/powerpc/kvm/book3s_64_vio.c
··· 36 36 #include <asm/ppc-opcode.h> 37 37 #include <asm/kvm_host.h> 38 38 #include <asm/udbg.h> 39 + #include <asm/iommu.h> 39 40 40 41 #define TCES_PER_PAGE (PAGE_SIZE / sizeof(u64)) 41 42 42 43 static unsigned long kvmppc_tce_pages(unsigned long window_size) 43 44 { 44 - return ALIGN((window_size >> SPAPR_TCE_SHIFT) 45 + return ALIGN((window_size >> IOMMU_PAGE_SHIFT_4K) 45 46 * sizeof(u64), PAGE_SIZE) / PAGE_SIZE; 46 47 } 47 48
+2 -2
arch/powerpc/kvm/book3s_64_vio_hv.c
··· 99 99 if (ret != H_SUCCESS) 100 100 return ret; 101 101 102 - idx = ioba >> SPAPR_TCE_SHIFT; 102 + idx = ioba >> IOMMU_PAGE_SHIFT_4K; 103 103 page = stt->pages[idx / TCES_PER_PAGE]; 104 104 tbl = (u64 *)page_address(page); 105 105 ··· 127 127 if (ret != H_SUCCESS) 128 128 return ret; 129 129 130 - idx = ioba >> SPAPR_TCE_SHIFT; 130 + idx = ioba >> IOMMU_PAGE_SHIFT_4K; 131 131 page = stt->pages[idx / TCES_PER_PAGE]; 132 132 tbl = (u64 *)page_address(page); 133 133