From 0197cd2e350a7151080e7335577e956f1f84a8cb Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Thu, 18 Oct 2007 16:53:19 -0500 Subject: [POWERPC] Add -mno-spe for ARCH=powerpc builds Newer GCC's are capable of autovectorization for ISA extensions like AltiVec and SPE. If we happen to build with one of those compilers we will get SPE instructions in random kernel code. Today we only allow basic interger code in the kernel and FP, AltiVec, or SPE in special explicit locations that have handled the proper saving and restoring of the register state (since on uniprocessor we lazy context switch the register state for FP, AltiVec, and SPE). -mno-spe disables the compiler for automatically generating SPE instructions without our knowledge. Signed-off-by: Kumar Gala --- arch/powerpc/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 4e165342210..bd87626c1f6 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -107,6 +107,9 @@ endif # No AltiVec instruction when building kernel KBUILD_CFLAGS += $(call cc-option,-mno-altivec) +# No SPE instruction when building kernel +KBUILD_CFLAGS += $(call cc-option,-mno-spe) + # Enable unit-at-a-time mode when possible. It shrinks the # kernel considerably. KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time) -- cgit v1.2.3 From 4c011b1fb853776459c7d3d7de7b14fa41f28c46 Mon Sep 17 00:00:00 2001 From: Scott Wood Date: Fri, 12 Oct 2007 15:19:11 -0500 Subject: [POWERPC] cpm: Fix a couple minor issues in cpm_common.c. A debugging printk is removed, and a comment is fixed to match the code. Signed-off-by: Scott Wood Signed-off-by: Kumar Gala --- arch/powerpc/sysdev/cpm_common.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/powerpc/sysdev/cpm_common.c b/arch/powerpc/sysdev/cpm_common.c index 66c8ad4cfce..165981c8778 100644 --- a/arch/powerpc/sysdev/cpm_common.c +++ b/arch/powerpc/sysdev/cpm_common.c @@ -77,8 +77,6 @@ int __init cpm_muram_init(void) int i = 0; int ret = 0; - printk("cpm_muram_init\n"); - spin_lock_init(&cpm_muram_lock); /* initialize the info header */ rh_init(&cpm_muram_info, 1, @@ -193,7 +191,7 @@ void __iomem *cpm_muram_addr(unsigned long offset) EXPORT_SYMBOL(cpm_muram_addr); /** - * cpm_muram_phys - turn a muram virtual address into a DMA address + * cpm_muram_dma - turn a muram virtual address into a DMA address * @offset: virtual address from cpm_muram_addr() to convert */ dma_addr_t cpm_muram_dma(void __iomem *addr) -- cgit v1.2.3 From 725fb29fd4bcda958b32f4479ad9934117c22019 Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Fri, 9 Nov 2007 03:51:14 -0600 Subject: [POWERPC] Fix oops related to 4xx flush_tlb_page modification kmap_atomic calls flush_tlb_page with a NULL VMA and thus we end up dereferencing a NULL pointer to try and get the context.id. If the VMA is null use the global pid value of 0. Signed-off-by: Kumar Gala --- include/asm-powerpc/tlbflush.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/asm-powerpc/tlbflush.h b/include/asm-powerpc/tlbflush.h index e7b4c0d298a..5c910814764 100644 --- a/include/asm-powerpc/tlbflush.h +++ b/include/asm-powerpc/tlbflush.h @@ -44,13 +44,13 @@ static inline void flush_tlb_mm(struct mm_struct *mm) static inline void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr) { - _tlbie(vmaddr, vma->vm_mm->context.id); + _tlbie(vmaddr, vma ? vma->vm_mm->context.id : 0); } static inline void flush_tlb_page_nohash(struct vm_area_struct *vma, unsigned long vmaddr) { - _tlbie(vmaddr, vma->vm_mm->context.id); + _tlbie(vmaddr, vma ? vma->vm_mm->context.id : 0); } static inline void flush_tlb_range(struct vm_area_struct *vma, -- cgit v1.2.3