Skip to contentSkip to conversation

Removing dead code

PATCH In review Christoph Egger 5 participants 17 messages Jun 9, 2010 – Jun 11, 2010 PowerPC

lore
Share & tools
lore
#0 lore raw

cover Removing dead code

Hi all!

As part of the VAMOS[0] research project at the University of
Erlangen we are looking at multiple integrity errors in linux' configuration system.

I've been running a check on the arch/powerpc sourcetree for
config Items not defined in Kconfig and found5 such chases. Sourcecode blocks depending on these Items are not reachable from a vanilla kernel -- dead code. I've seen such dead blocks made on purpose e.g. while integrating new features into the kernel but generally they're just useless.

Each of the patches in this patchset removes on such dead
config Item, I'd be glad if you consider applying them. I've been doing deeper analysis of such issues before and can do so again but I'm not so sure they were fastly usefull. However I've done a testbuild on ppc with allmodconfig so it should at least build.

Please keep me informed of this patch getting confirmed /
merged so we can keep track of it.

Regards

Christoph Egger

[0] http://vamos1.informatik.uni-erlangen.de/

Christoph Egger (5):
Removing dead BOOK3E_MMU_TLB_STATS
Removing dead CONFIG_HIGHPTE
Removing dead CONFIG_SMP_750
Removing dead CONFIG_SERIAL_TEXT_DEBUG
Removing dead CONFIG_PPC47x

 arch/powerpc/include/asm/exception-64e.h |   38 ------------------------------
 arch/powerpc/kernel/head_40x.S           |   19 ---------------
 arch/powerpc/mm/44x_mmu.c                |    4 ---
 arch/powerpc/mm/pgtable_32.c             |    4 ---
 arch/powerpc/mm/tlb_hash32.c             |    4 ---
 arch/powerpc/mm/tlb_low_64e.S            |    9 -------
 6 files changed, 0 insertions(+), 78 deletions(-)
#1 lore raw

PATCH 1/5 Removing dead BOOK3E_MMU_TLB_STATS

BOOK3E_MMU_TLB_STATS doesn't exist in Kconfig, therefore removing all references for it from the source code.

---
 arch/powerpc/include/asm/exception-64e.h |   38 ------------------------------
 arch/powerpc/mm/tlb_low_64e.S            |    9 -------
 2 files changed, 0 insertions(+), 47 deletions(-)
arch/powerpc/include/asm/exception-64e.h +0 -38
index 6d53f31..db74814 100644
@@ -65,14 +65,7 @@
 #define EX_TLB_MMUCR0	(12 * 8) /* Level 0 */
 #define EX_TLB_MAS1	(12 * 8) /* Level 0 */
 #define EX_TLB_MAS2	(13 * 8) /* Level 0 */
-#ifdef CONFIG_BOOK3E_MMU_TLB_STATS
-#define EX_TLB_R8	(14 * 8)
-#define EX_TLB_R9	(15 * 8)
-#define EX_TLB_LR	(16 * 8)
-#define EX_TLB_SIZE	(17 * 8)
-#else
 #define EX_TLB_SIZE	(14 * 8)
-#endif
 
 #define	START_EXCEPTION(label)						\
 	.globl exc_##label##_book3e;					\
@@ -157,36 +150,6 @@ exc_##label##_book3e:
 	addi	r11,r13,PACA_EXTLB;					    \
 	TLB_MISS_RESTORE(r11)
 
-#ifdef CONFIG_BOOK3E_MMU_TLB_STATS
-#define TLB_MISS_PROLOG_STATS						    \
-	mflr	r10;							    \
-	std	r8,EX_TLB_R8(r12);					    \
-	std	r9,EX_TLB_R9(r12);					    \
-	std	r10,EX_TLB_LR(r12);
-#define TLB_MISS_RESTORE_STATS					            \
-	ld	r16,EX_TLB_LR(r12);					    \
-	ld	r9,EX_TLB_R9(r12);					    \
-	ld	r8,EX_TLB_R8(r12);					    \
-	mtlr	r16;
-#define TLB_MISS_STATS_D(name)						    \
-	addi	r9,r13,MMSTAT_DSTATS+name;				    \
-	bl	.tlb_stat_inc;
-#define TLB_MISS_STATS_I(name)						    \
-	addi	r9,r13,MMSTAT_ISTATS+name;				    \
-	bl	.tlb_stat_inc;
-#define TLB_MISS_STATS_X(name)						    \
-	ld	r8,PACA_EXTLB+EX_TLB_ESR(r13);				    \
-	cmpdi	cr2,r8,-1;						    \
-	beq	cr2,61f;						    \
-	addi	r9,r13,MMSTAT_DSTATS+name;				    \
-	b	62f;							    \
-61:	addi	r9,r13,MMSTAT_ISTATS+name;				    \
-62:	bl	.tlb_stat_inc;
-#define TLB_MISS_STATS_SAVE_INFO					    \
-	std	r14,EX_TLB_ESR(r12);	/* save ESR */			    \
-
-
-#else
 #define TLB_MISS_PROLOG_STATS
 #define TLB_MISS_RESTORE_STATS
 #define TLB_MISS_STATS_D(name)
@@ -194,7 +157,6 @@ exc_##label##_book3e:
 #define TLB_MISS_STATS_X(name)
 #define TLB_MISS_STATS_Y(name)
 #define TLB_MISS_STATS_SAVE_INFO
-#endif
 
 #define SET_IVOR(vector_number, vector_offset)	\
 	li	r3,vector_offset@l; 		\
arch/powerpc/mm/tlb_low_64e.S +0 -9
index 8b04c54..4d7d059 100644
@@ -758,12 +758,3 @@ tlb_load_linear_fault:
 1:	TLB_MISS_EPILOG_ERROR_SPECIAL
 	b	exc_instruction_storage_book3e
 
-
-#ifdef CONFIG_BOOK3E_MMU_TLB_STATS
-.tlb_stat_inc:
-1:	ldarx	r8,0,r9
-	addi	r8,r8,1
-	stdcx.	r8,0,r9
-	bne-	1b
-	blr
-#endif
Signature · 1 line
1.6.3.3
#2 lore raw

Re: [PATCH 1/5] Removing dead BOOK3E_MMU_TLB_STATS

Quoted 2 lines · Christoph Egger

BOOK3E_MMU_TLB_STATS doesn't exist in Kconfig, therefore removing all references for it from the source code.

Heh, thanks but no :-)

I want to keep that code here, until we hook it up again. It was hooked up properly in some internal stuff that didn't go upstream for some reason and I need to fix that.

Cheers,
Ben.

Quoted 87 lines
---
 arch/powerpc/include/asm/exception-64e.h |   38 ------------------------------
 arch/powerpc/mm/tlb_low_64e.S            |    9 -------
 2 files changed, 0 insertions(+), 47 deletions(-)
arch/powerpc/include/asm/exception-64e.h +0 -38
index 6d53f31..db74814 100644
@@ -65,14 +65,7 @@
 #define EX_TLB_MMUCR0	(12 * 8) /* Level 0 */
 #define EX_TLB_MAS1	(12 * 8) /* Level 0 */
 #define EX_TLB_MAS2	(13 * 8) /* Level 0 */
-#ifdef CONFIG_BOOK3E_MMU_TLB_STATS
-#define EX_TLB_R8	(14 * 8)
-#define EX_TLB_R9	(15 * 8)
-#define EX_TLB_LR	(16 * 8)
-#define EX_TLB_SIZE	(17 * 8)
-#else
 #define EX_TLB_SIZE	(14 * 8)
-#endif
 
 #define	START_EXCEPTION(label)						\
 	.globl exc_##label##_book3e;					\
@@ -157,36 +150,6 @@ exc_##label##_book3e:
 	addi	r11,r13,PACA_EXTLB;					    \
 	TLB_MISS_RESTORE(r11)
 
-#ifdef CONFIG_BOOK3E_MMU_TLB_STATS
-#define TLB_MISS_PROLOG_STATS						    \
-	mflr	r10;							    \
-	std	r8,EX_TLB_R8(r12);					    \
-	std	r9,EX_TLB_R9(r12);					    \
-	std	r10,EX_TLB_LR(r12);
-#define TLB_MISS_RESTORE_STATS					            \
-	ld	r16,EX_TLB_LR(r12);					    \
-	ld	r9,EX_TLB_R9(r12);					    \
-	ld	r8,EX_TLB_R8(r12);					    \
-	mtlr	r16;
-#define TLB_MISS_STATS_D(name)						    \
-	addi	r9,r13,MMSTAT_DSTATS+name;				    \
-	bl	.tlb_stat_inc;
-#define TLB_MISS_STATS_I(name)						    \
-	addi	r9,r13,MMSTAT_ISTATS+name;				    \
-	bl	.tlb_stat_inc;
-#define TLB_MISS_STATS_X(name)						    \
-	ld	r8,PACA_EXTLB+EX_TLB_ESR(r13);				    \
-	cmpdi	cr2,r8,-1;						    \
-	beq	cr2,61f;						    \
-	addi	r9,r13,MMSTAT_DSTATS+name;				    \
-	b	62f;							    \
-61:	addi	r9,r13,MMSTAT_ISTATS+name;				    \
-62:	bl	.tlb_stat_inc;
-#define TLB_MISS_STATS_SAVE_INFO					    \
-	std	r14,EX_TLB_ESR(r12);	/* save ESR */			    \
-
-
-#else
 #define TLB_MISS_PROLOG_STATS
 #define TLB_MISS_RESTORE_STATS
 #define TLB_MISS_STATS_D(name)
@@ -194,7 +157,6 @@ exc_##label##_book3e:
 #define TLB_MISS_STATS_X(name)
 #define TLB_MISS_STATS_Y(name)
 #define TLB_MISS_STATS_SAVE_INFO
-#endif
 
 #define SET_IVOR(vector_number, vector_offset)	\
 	li	r3,vector_offset@l; 		\
arch/powerpc/mm/tlb_low_64e.S +0 -9
index 8b04c54..4d7d059 100644
@@ -758,12 +758,3 @@ tlb_load_linear_fault:
 1:	TLB_MISS_EPILOG_ERROR_SPECIAL
 	b	exc_instruction_storage_book3e
 
-
-#ifdef CONFIG_BOOK3E_MMU_TLB_STATS
-.tlb_stat_inc:
-1:	ldarx	r8,0,r9
-	addi	r8,r8,1
-	stdcx.	r8,0,r9
-	bne-	1b
-	blr
-#endif
#3 lore raw

PATCH 2/5 Removing dead CONFIG_HIGHPTE

In reply to Christoph Egger

CONFIG_HIGHPTE doesn't exist in Kconfig, therefore removing all references for it from the source code.

---
 arch/powerpc/mm/pgtable_32.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
arch/powerpc/mm/pgtable_32.c +0 -4
index 9fc02dc..34347b2 100644
@@ -115,11 +115,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm, unsigned long address)
 {
 	struct page *ptepage;
 
-#ifdef CONFIG_HIGHPTE
-	gfp_t flags = GFP_KERNEL | __GFP_HIGHMEM | __GFP_REPEAT | __GFP_ZERO;
-#else
 	gfp_t flags = GFP_KERNEL | __GFP_REPEAT | __GFP_ZERO;
-#endif
 
 	ptepage = alloc_pages(flags, 0);
 	if (!ptepage)
Signature · 1 line
1.6.3.3
#4 lore raw

PATCH 3/5 Removing dead CONFIG_SMP_750

In reply to Christoph Egger

CONFIG_SMP_750 doesn't exist in Kconfig, therefore removing all references for it from the source code.

---
 arch/powerpc/mm/tlb_hash32.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
arch/powerpc/mm/tlb_hash32.c +0 -4
index 8aaa8b7..925fecb 100644
@@ -94,11 +94,7 @@ void tlb_flush(struct mmu_gather *tlb)
  * the cache operations on the bus.  Hence we need to use an IPI
  * to get the other CPU(s) to invalidate their TLBs.
  */
-#ifdef CONFIG_SMP_750
-#define FINISH_FLUSH	smp_send_tlb_invalidate(0)
-#else
 #define FINISH_FLUSH	do { } while (0)
-#endif
 
 static void flush_range(struct mm_struct *mm, unsigned long start,
 			unsigned long end)
Signature · 1 line
1.6.3.3
#5 lore raw

Re: [PATCH 3/5] Removing dead CONFIG_SMP_750

Quoted 2 lines · Christoph Egger

CONFIG_SMP_750 doesn't exist in Kconfig, therefore removing all references for it from the source code.

Yeah, we don't support SMP on 750 at the moment. This code was carried over from the arch/ppc days, and that code was present pre-git. I think we can drop it, but I'll leave that up to Ben. Maybe he has crazy plans for a 750 SMP board.

josh

Quoted 29 lines

---
arch/powerpc/mm/tlb_hash32.c | 4 ----

1 files changed, 0 insertions(+), 4 deletions(-)
arch/powerpc/mm/tlb_hash32.c +0 -4
index 8aaa8b7..925fecb 100644
@@ -94,11 +94,7 @@ void tlb_flush(struct mmu_gather *tlb)
 * the cache operations on the bus.  Hence we need to use an IPI
 * to get the other CPU(s) to invalidate their TLBs.
 */
-#ifdef CONFIG_SMP_750
-#define FINISH_FLUSH	smp_send_tlb_invalidate(0)
-#else
 #define FINISH_FLUSH	do { } while (0)
-#endif
 
 static void flush_range(struct mm_struct *mm, unsigned long start,
 			unsigned long end)
Signature · 6 lines
1.6.3.3

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev
#6 lore raw

Re: [PATCH 3/5] Removing dead CONFIG_SMP_750

Quoted 8 lines · Josh Boyer
Quoted 2 lines · Christoph Egger

CONFIG_SMP_750 doesn't exist in Kconfig, therefore removing all references for it from the source code.

Yeah, we don't support SMP on 750 at the moment. This code was carried over from the arch/ppc days, and that code was present pre-git. I think we can drop it, but I'll leave that up to Ben. Maybe he has crazy plans for a 750 SMP board.

Nope :-) Though it would be nice to also remove the call sites too and thus remove the macro entirely.

Cheers,
Ben.

Quoted 36 lines

josh

Quoted 29 lines

---
arch/powerpc/mm/tlb_hash32.c | 4 ----

1 files changed, 0 insertions(+), 4 deletions(-)
arch/powerpc/mm/tlb_hash32.c +0 -4
index 8aaa8b7..925fecb 100644
@@ -94,11 +94,7 @@ void tlb_flush(struct mmu_gather *tlb)
 * the cache operations on the bus.  Hence we need to use an IPI
 * to get the other CPU(s) to invalidate their TLBs.
 */
-#ifdef CONFIG_SMP_750
-#define FINISH_FLUSH	smp_send_tlb_invalidate(0)
-#else
 #define FINISH_FLUSH	do { } while (0)
-#endif
 
 static void flush_range(struct mm_struct *mm, unsigned long start,
 			unsigned long end)
Signature · 6 lines
1.6.3.3

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

#7 lore raw

Re: [PATCH 3/5] Removing dead CONFIG_SMP_750

Quoted 5 lines · Benjamin Herrenschmidt
Quoted 4 lines · Josh Boyer
Quoted 2 lines · Christoph Egger

CONFIG_SMP_750 doesn't exist in Kconfig, therefore removing all references for it from the source code.

Quoted 7 lines
Quoted 4 lines

Yeah, we don't support SMP on 750 at the moment. This code was carried over from the arch/ppc days, and that code was present pre-git. I think we can drop it, but I'll leave that up to Ben. Maybe he has crazy plans for a 750 SMP board.

Nope :-) Though it would be nice to also remove the call sites too and thus remove the macro entirely.

SOmething like below?

-----
From: Christoph Egger <[email protected]>
Subject: [PATCH 3/5] Removing dead CONFIG_SMP_750

CONFIG_SMP_750 doesn't exist in Kconfig, therefore removing all references for it from the source code.

arch/powerpc/mm/tlb_hash32.c +0 -9
index 8aaa8b7..09c7820 100644
@@ -94,11 +94,6 @@ void tlb_flush(struct mmu_gather *tlb)
  * the cache operations on the bus.  Hence we need to use an IPI
  * to get the other CPU(s) to invalidate their TLBs.
  */
-#ifdef CONFIG_SMP_750
-#define FINISH_FLUSH   smp_send_tlb_invalidate(0)
-#else
-#define FINISH_FLUSH   do { } while (0)
-#endif
 
 static void flush_range(struct mm_struct *mm, unsigned long start,
                        unsigned long end)
@@ -138,7 +133,6 @@ static void flush_range(struct mm_struct *mm, unsigned long start,
 void flush_tlb_kernel_range(unsigned long start, unsigned long end)
 {
        flush_range(&init_mm, start, end);
-       FINISH_FLUSH;
 }
 EXPORT_SYMBOL(flush_tlb_kernel_range);
 
@@ -162,7 +156,6 @@ void flush_tlb_mm(struct mm_struct *mm)
         */
        for (mp = mm->mmap; mp != NULL; mp = mp->vm_next)
                flush_range(mp->vm_mm, mp->vm_start, mp->vm_end);
-       FINISH_FLUSH;
 }
 EXPORT_SYMBOL(flush_tlb_mm);
 
@@ -179,7 +172,6 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
        pmd = pmd_offset(pud_offset(pgd_offset(mm, vmaddr), vmaddr), vmaddr);
        if (!pmd_none(*pmd))
                flush_hash_pages(mm->context.id, vmaddr, pmd_val(*pmd), 1);
-       FINISH_FLUSH;
 }
 EXPORT_SYMBOL(flush_tlb_page);
 
@@ -192,6 +184,5 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
                     unsigned long end)
 {
        flush_range(vma->vm_mm, start, end);
-       FINISH_FLUSH;
 }
 EXPORT_SYMBOL(flush_tlb_range);
Signature · 1 line
1.6.3.3
#8 lore raw

Re: [PATCH 3/5] Removing dead CONFIG_SMP_750

Quoted 11 lines · Christoph Egger
Quoted 10 lines · Benjamin Herrenschmidt
Quoted 8 lines · Josh Boyer
Quoted 2 lines · Christoph Egger

CONFIG_SMP_750 doesn't exist in Kconfig, therefore removing all references for it from the source code.

Yeah, we don't support SMP on 750 at the moment. This code was carried over from the arch/ppc days, and that code was present pre-git. I think we can drop it, but I'll leave that up to Ben. Maybe he has crazy plans for a 750 SMP board.

Quoted 4 lines
Quoted 2 lines

Nope :-) Though it would be nice to also remove the call sites too and thus remove the macro entirely.

SOmething like below?

Excellent. Thanks. I'll add that to the batch I'm preparing for Linus.

Cheers,
Ben.

Quoted 56 lines

-----
From: Christoph Egger <[email protected]>
Subject: [PATCH 3/5] Removing dead CONFIG_SMP_750

CONFIG_SMP_750 doesn't exist in Kconfig, therefore removing all references for it from the source code.

arch/powerpc/mm/tlb_hash32.c +0 -9
index 8aaa8b7..09c7820 100644
@@ -94,11 +94,6 @@ void tlb_flush(struct mmu_gather *tlb)
  * the cache operations on the bus.  Hence we need to use an IPI
  * to get the other CPU(s) to invalidate their TLBs.
  */
-#ifdef CONFIG_SMP_750
-#define FINISH_FLUSH   smp_send_tlb_invalidate(0)
-#else
-#define FINISH_FLUSH   do { } while (0)
-#endif
 
 static void flush_range(struct mm_struct *mm, unsigned long start,
                        unsigned long end)
@@ -138,7 +133,6 @@ static void flush_range(struct mm_struct *mm, unsigned long start,
 void flush_tlb_kernel_range(unsigned long start, unsigned long end)
 {
        flush_range(&init_mm, start, end);
-       FINISH_FLUSH;
 }
 EXPORT_SYMBOL(flush_tlb_kernel_range);
 
@@ -162,7 +156,6 @@ void flush_tlb_mm(struct mm_struct *mm)
         */
        for (mp = mm->mmap; mp != NULL; mp = mp->vm_next)
                flush_range(mp->vm_mm, mp->vm_start, mp->vm_end);
-       FINISH_FLUSH;
 }
 EXPORT_SYMBOL(flush_tlb_mm);
 
@@ -179,7 +172,6 @@ void flush_tlb_page(struct vm_area_struct *vma, unsigned long vmaddr)
        pmd = pmd_offset(pud_offset(pgd_offset(mm, vmaddr), vmaddr), vmaddr);
        if (!pmd_none(*pmd))
                flush_hash_pages(mm->context.id, vmaddr, pmd_val(*pmd), 1);
-       FINISH_FLUSH;
 }
 EXPORT_SYMBOL(flush_tlb_page);
 
@@ -192,6 +184,5 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start,
                     unsigned long end)
 {
        flush_range(vma->vm_mm, start, end);
-       FINISH_FLUSH;
 }
 EXPORT_SYMBOL(flush_tlb_range);
#9 lore raw

PATCH 4/5 Removing dead CONFIG_SERIAL_TEXT_DEBUG

In reply to Christoph Egger

CONFIG_SERIAL_TEXT_DEBUG doesn't exist in Kconfig, therefore removing all references for it from the source code.

---
 arch/powerpc/kernel/head_40x.S |   19 -------------------
 1 files changed, 0 insertions(+), 19 deletions(-)
arch/powerpc/kernel/head_40x.S +0 -19
index a90625f..1a10e4d 100644
@@ -939,25 +939,6 @@ initial_mmu:
 	tlbwe	r4,r0,TLB_DATA		/* Load the data portion of the entry */
 	tlbwe	r3,r0,TLB_TAG		/* Load the tag portion of the entry */
 
-#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(SERIAL_DEBUG_IO_BASE)
-
-	/* Load a TLB entry for the UART, so that ppc4xx_progress() can use
-	 * the UARTs nice and early.  We use a 4k real==virtual mapping. */
-
-	lis	r3,SERIAL_DEBUG_IO_BASE@h
-	ori	r3,r3,SERIAL_DEBUG_IO_BASE@l
-	mr	r4,r3
-	clrrwi	r4,r4,12
-	ori	r4,r4,(TLB_WR|TLB_I|TLB_M|TLB_G)
-
-	clrrwi	r3,r3,12
-	ori	r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_4K))
-
-	li	r0,0			/* TLB slot 0 */
-	tlbwe	r4,r0,TLB_DATA
-	tlbwe	r3,r0,TLB_TAG
-#endif /* CONFIG_SERIAL_DEBUG_TEXT && SERIAL_DEBUG_IO_BASE */
-
 	isync
 
 	/* Establish the exception vector base
Signature · 1 line
1.6.3.3
#10 lore raw

Re: [PATCH 4/5] Removing dead CONFIG_SERIAL_TEXT_DEBUG

Quoted 4 lines · Christoph Egger

CONFIG_SERIAL_TEXT_DEBUG doesn't exist in Kconfig, therefore removing all references for it from the source code.

It would be better to conver this to work with CONFIG_PPC_EARLY_DEBUG and CONFIG_PPC_EARLY_DEBUG_40x. I'd rather just leave this for now until we can get it switched over.

josh

Quoted 41 lines

---
arch/powerpc/kernel/head_40x.S | 19 -------------------

1 files changed, 0 insertions(+), 19 deletions(-)
arch/powerpc/kernel/head_40x.S +0 -19
index a90625f..1a10e4d 100644
@@ -939,25 +939,6 @@ initial_mmu:
 	tlbwe	r4,r0,TLB_DATA		/* Load the data portion of the entry */
 	tlbwe	r3,r0,TLB_TAG		/* Load the tag portion of the entry */
 
-#if defined(CONFIG_SERIAL_TEXT_DEBUG) && defined(SERIAL_DEBUG_IO_BASE)
-
-	/* Load a TLB entry for the UART, so that ppc4xx_progress() can use
-	 * the UARTs nice and early.  We use a 4k real==virtual mapping. */
-
-	lis	r3,SERIAL_DEBUG_IO_BASE@h
-	ori	r3,r3,SERIAL_DEBUG_IO_BASE@l
-	mr	r4,r3
-	clrrwi	r4,r4,12
-	ori	r4,r4,(TLB_WR|TLB_I|TLB_M|TLB_G)
-
-	clrrwi	r3,r3,12
-	ori	r3,r3,(TLB_VALID | TLB_PAGESZ(PAGESZ_4K))
-
-	li	r0,0			/* TLB slot 0 */
-	tlbwe	r4,r0,TLB_DATA
-	tlbwe	r3,r0,TLB_TAG
-#endif /* CONFIG_SERIAL_DEBUG_TEXT && SERIAL_DEBUG_IO_BASE */
-
 	isync
 
 	/* Establish the exception vector base
Signature · 6 lines
1.6.3.3

_______________________________________________
Linuxppc-dev mailing list
[email protected]
https://lists.ozlabs.org/listinfo/linuxppc-dev
#11 lore raw

PATCH 5/5 Removing dead CONFIG_PPC47x

In reply to Christoph Egger

CONFIG_PPC47x doesn't exist in Kconfig, therefore removing all references for it from the source code.

---
 arch/powerpc/mm/44x_mmu.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
arch/powerpc/mm/44x_mmu.c +0 -4
index d8c6efb..f70da7e 100644
@@ -76,11 +76,7 @@ static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys)
 		"tlbwe	%1,%3,%5\n"
 		"tlbwe	%0,%3,%6\n"
 	:
-#ifdef CONFIG_PPC47x
-	: "r" (PPC47x_TLB2_S_RWX),
-#else
 	: "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
-#endif
 	  "r" (phys),
 	  "r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M),
 	  "r" (entry),
Signature · 1 line
1.6.3.3
#12 lore raw

PATCH 1/1 Removing dead CONFIG_PPC47x

In reply to Christoph Egger

CONFIG_PPC47x should actually be spelled CONFIG_PPC_47x as reported by Andreas Schwab.

---
 arch/powerpc/mm/44x_mmu.c |    4 ----
 1 files changed, 0 insertions(+), 4 deletions(-)
arch/powerpc/mm/44x_mmu.c +1 -1
index d8c6efb..f70da7e 100644
@@ -76,11 +76,11 @@ static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys)
 		"tlbwe	%1,%3,%5\n"
 		"tlbwe	%0,%3,%6\n"
 	:
-#ifdef CONFIG_PPC47x
+#ifdef CONFIG_PPC_47x
 	: "r" (PPC47x_TLB2_S_RWX),
 #else
 	: "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
 #endif
 	  "r" (phys),
 	  "r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M),
 	  "r" (entry),
Signature · 1 line
1.6.3.3
#13 lore raw

Re: [PATCH 5b/5] Removing dead CONFIG_PPC47x

Quoted 4 lines · Christoph Egger

CONFIG_PPC47x should actually be spelled CONFIG_PPC_47x as reported by Andreas Schwab.

Thanks, I'll pull this one in and get it merged.

josh

Quoted 24 lines

---
arch/powerpc/mm/44x_mmu.c | 4 ----

1 files changed, 0 insertions(+), 4 deletions(-)
arch/powerpc/mm/44x_mmu.c +1 -1
index d8c6efb..f70da7e 100644
@@ -76,11 +76,11 @@ static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys)
 		"tlbwe	%1,%3,%5\n"
 		"tlbwe	%0,%3,%6\n"
 	:
-#ifdef CONFIG_PPC47x
+#ifdef CONFIG_PPC_47x
 	: "r" (PPC47x_TLB2_S_RWX),
 #else
 	: "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
 #endif
 	  "r" (phys),
 	  "r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M),
 	  "r" (entry),
Signature · 1 line
1.6.3.3
#14 lore raw

Re: [PATCH 5b/5] Removing dead CONFIG_PPC47x

Quoted 7 lines · Josh Boyer
Quoted 4 lines · Christoph Egger

CONFIG_PPC47x should actually be spelled CONFIG_PPC_47x as reported by Andreas Schwab.

Thanks, I'll pull this one in and get it merged.

I pulled your tree along with a couple of other things. I'll do a few tests tomorrow before sending to Linus.

Cheers,
Ben.

Quoted 26 lines

josh

Quoted 24 lines

---
arch/powerpc/mm/44x_mmu.c | 4 ----

1 files changed, 0 insertions(+), 4 deletions(-)
arch/powerpc/mm/44x_mmu.c +1 -1
index d8c6efb..f70da7e 100644
@@ -76,11 +76,11 @@ static void __init ppc44x_pin_tlb(unsigned int virt, unsigned int phys)
 		"tlbwe	%1,%3,%5\n"
 		"tlbwe	%0,%3,%6\n"
 	:
-#ifdef CONFIG_PPC47x
+#ifdef CONFIG_PPC_47x
 	: "r" (PPC47x_TLB2_S_RWX),
 #else
 	: "r" (PPC44x_TLB_SW | PPC44x_TLB_SR | PPC44x_TLB_SX | PPC44x_TLB_G),
 #endif
 	  "r" (phys),
 	  "r" (virt | PPC44x_TLB_VALID | PPC44x_TLB_256M),
 	  "r" (entry),
Signature · 1 line
1.6.3.3
#16 lore raw
Quoted 8 lines · Joe Perches

(cc's trimmed and rpjday added)

Quoted 2 lines · Christoph Egger

I've been running a check on the arch/powerpc sourcetree for config Items not defined in Kconfig and found5 such chases.

Are you aware of
http://www.crashcourse.ca/wiki/index.php/Kernel_cleanup_scripts

Yes, we are. These scripts aim at a very similar goal. However, we are using a more sound approach that actually involves parsing CPP statements and the kconfig language and checking the resulting constraints with SAT solving tools. This way, we get way more precise results.

You can read about our approach in [1].

[1] http://portal.acm.org/citation.cfm?id=1629732

Signature · 3 lines
Reinhard Tartler                     Department of Computer Science IV
Martensstr 1, 91058 Erlangen Germany, University of Erlangen-Nuremberg
            http://www4.informatik.uni-erlangen.de/~tartler