diff options
Diffstat (limited to 'arch/sparc/mm/init_64.c')
-rw-r--r-- | arch/sparc/mm/init_64.c | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 3fd8e18bed8..581531dbc8b 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c | |||
@@ -1597,6 +1597,44 @@ static void __init tsb_phys_patch(void) | |||
1597 | static struct hv_tsb_descr ktsb_descr[NUM_KTSB_DESCR]; | 1597 | static struct hv_tsb_descr ktsb_descr[NUM_KTSB_DESCR]; |
1598 | extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES]; | 1598 | extern struct tsb swapper_tsb[KERNEL_TSB_NENTRIES]; |
1599 | 1599 | ||
1600 | static void patch_one_ktsb_phys(unsigned int *start, unsigned int *end, unsigned long pa) | ||
1601 | { | ||
1602 | pa >>= KTSB_PHYS_SHIFT; | ||
1603 | |||
1604 | while (start < end) { | ||
1605 | unsigned int *ia = (unsigned int *)(unsigned long)*start; | ||
1606 | |||
1607 | ia[0] = (ia[0] & ~0x3fffff) | (pa >> 10); | ||
1608 | __asm__ __volatile__("flush %0" : : "r" (ia)); | ||
1609 | |||
1610 | ia[1] = (ia[1] & ~0x3ff) | (pa & 0x3ff); | ||
1611 | __asm__ __volatile__("flush %0" : : "r" (ia + 1)); | ||
1612 | |||
1613 | start++; | ||
1614 | } | ||
1615 | } | ||
1616 | |||
1617 | static void ktsb_phys_patch(void) | ||
1618 | { | ||
1619 | extern unsigned int __swapper_tsb_phys_patch; | ||
1620 | extern unsigned int __swapper_tsb_phys_patch_end; | ||
1621 | unsigned long ktsb_pa; | ||
1622 | |||
1623 | ktsb_pa = kern_base + ((unsigned long)&swapper_tsb[0] - KERNBASE); | ||
1624 | patch_one_ktsb_phys(&__swapper_tsb_phys_patch, | ||
1625 | &__swapper_tsb_phys_patch_end, ktsb_pa); | ||
1626 | #ifndef CONFIG_DEBUG_PAGEALLOC | ||
1627 | { | ||
1628 | extern unsigned int __swapper_4m_tsb_phys_patch; | ||
1629 | extern unsigned int __swapper_4m_tsb_phys_patch_end; | ||
1630 | ktsb_pa = (kern_base + | ||
1631 | ((unsigned long)&swapper_4m_tsb[0] - KERNBASE)); | ||
1632 | patch_one_ktsb_phys(&__swapper_4m_tsb_phys_patch, | ||
1633 | &__swapper_4m_tsb_phys_patch_end, ktsb_pa); | ||
1634 | } | ||
1635 | #endif | ||
1636 | } | ||
1637 | |||
1600 | static void __init sun4v_ktsb_init(void) | 1638 | static void __init sun4v_ktsb_init(void) |
1601 | { | 1639 | { |
1602 | unsigned long ktsb_pa; | 1640 | unsigned long ktsb_pa; |
@@ -1716,8 +1754,10 @@ void __init paging_init(void) | |||
1716 | sun4u_pgprot_init(); | 1754 | sun4u_pgprot_init(); |
1717 | 1755 | ||
1718 | if (tlb_type == cheetah_plus || | 1756 | if (tlb_type == cheetah_plus || |
1719 | tlb_type == hypervisor) | 1757 | tlb_type == hypervisor) { |
1720 | tsb_phys_patch(); | 1758 | tsb_phys_patch(); |
1759 | ktsb_phys_patch(); | ||
1760 | } | ||
1721 | 1761 | ||
1722 | if (tlb_type == hypervisor) { | 1762 | if (tlb_type == hypervisor) { |
1723 | sun4v_patch_tlb_handlers(); | 1763 | sun4v_patch_tlb_handlers(); |