|
33 | 33 | #include <linux/swap.h>
|
34 | 34 | #include <linux/stddef.h>
|
35 | 35 | #include <linux/vmalloc.h>
|
36 |
| -#include <linux/memblock.h> |
37 | 36 | #include <linux/slab.h>
|
38 | 37 | #include <linux/hugetlb.h>
|
39 | 38 |
|
|
47 | 46 | #include <asm/smp.h>
|
48 | 47 | #include <asm/machdep.h>
|
49 | 48 | #include <asm/tlb.h>
|
50 |
| -#include <asm/trace.h> |
51 | 49 | #include <asm/processor.h>
|
52 | 50 | #include <asm/cputable.h>
|
53 | 51 | #include <asm/sections.h>
|
54 | 52 | #include <asm/firmware.h>
|
55 | 53 | #include <asm/dma.h>
|
56 |
| -#include <asm/powernv.h> |
57 | 54 |
|
58 | 55 | #include "mmu_decl.h"
|
59 | 56 |
|
@@ -429,59 +426,6 @@ void pgtable_free_tlb(struct mmu_gather *tlb, void *table, int shift)
|
429 | 426 | }
|
430 | 427 | #endif
|
431 | 428 |
|
432 |
| -#ifdef CONFIG_PPC_BOOK3S_64 |
433 |
| -void __init mmu_partition_table_init(void) |
434 |
| -{ |
435 |
| - unsigned long patb_size = 1UL << PATB_SIZE_SHIFT; |
436 |
| - unsigned long ptcr; |
437 |
| - |
438 |
| - BUILD_BUG_ON_MSG((PATB_SIZE_SHIFT > 36), "Partition table size too large."); |
439 |
| - partition_tb = __va(memblock_alloc_base(patb_size, patb_size, |
440 |
| - MEMBLOCK_ALLOC_ANYWHERE)); |
441 |
| - |
442 |
| - /* Initialize the Partition Table with no entries */ |
443 |
| - memset((void *)partition_tb, 0, patb_size); |
444 |
| - |
445 |
| - /* |
446 |
| - * update partition table control register, |
447 |
| - * 64 K size. |
448 |
| - */ |
449 |
| - ptcr = __pa(partition_tb) | (PATB_SIZE_SHIFT - 12); |
450 |
| - mtspr(SPRN_PTCR, ptcr); |
451 |
| - powernv_set_nmmu_ptcr(ptcr); |
452 |
| -} |
453 |
| - |
454 |
| -void mmu_partition_table_set_entry(unsigned int lpid, unsigned long dw0, |
455 |
| - unsigned long dw1) |
456 |
| -{ |
457 |
| - unsigned long old = be64_to_cpu(partition_tb[lpid].patb0); |
458 |
| - |
459 |
| - partition_tb[lpid].patb0 = cpu_to_be64(dw0); |
460 |
| - partition_tb[lpid].patb1 = cpu_to_be64(dw1); |
461 |
| - |
462 |
| - /* |
463 |
| - * Global flush of TLBs and partition table caches for this lpid. |
464 |
| - * The type of flush (hash or radix) depends on what the previous |
465 |
| - * use of this partition ID was, not the new use. |
466 |
| - */ |
467 |
| - asm volatile("ptesync" : : : "memory"); |
468 |
| - if (old & PATB_HR) { |
469 |
| - asm volatile(PPC_TLBIE_5(%0,%1,2,0,1) : : |
470 |
| - "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid)); |
471 |
| - asm volatile(PPC_TLBIE_5(%0,%1,2,1,1) : : |
472 |
| - "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid)); |
473 |
| - trace_tlbie(lpid, 0, TLBIEL_INVAL_SET_LPID, lpid, 2, 0, 1); |
474 |
| - } else { |
475 |
| - asm volatile(PPC_TLBIE_5(%0,%1,2,0,0) : : |
476 |
| - "r" (TLBIEL_INVAL_SET_LPID), "r" (lpid)); |
477 |
| - trace_tlbie(lpid, 0, TLBIEL_INVAL_SET_LPID, lpid, 2, 0, 0); |
478 |
| - } |
479 |
| - /* do we need fixup here ?*/ |
480 |
| - asm volatile("eieio; tlbsync; ptesync" : : : "memory"); |
481 |
| -} |
482 |
| -EXPORT_SYMBOL_GPL(mmu_partition_table_set_entry); |
483 |
| -#endif /* CONFIG_PPC_BOOK3S_64 */ |
484 |
| - |
485 | 429 | #ifdef CONFIG_STRICT_KERNEL_RWX
|
486 | 430 | void mark_rodata_ro(void)
|
487 | 431 | {
|
|
0 commit comments