Lines Matching +full:supervisor +full:- +full:mode +full:- +full:visible

5  *  Copyright (c) 2003-2007 Jocelyn Mayer
23 #include "disas/dis-asm.h"
28 #include "cpu-models.h"
29 #include "mmu-hash32.h"
30 #include "mmu-hash64.h"
31 #include "qemu/error-report.h"
33 #include "qemu/qemu-print.h"
37 #include "hw/qdev-properties.h"
39 #include "mmu-book3s-v3.h"
47 #include "power8-pmu.h"
61 /* Altivec always uses round-to-nearest */ in vscr_init()
62 set_float_rounding_mode(float_round_nearest_even, &env->vec_status); in vscr_init()
675 #define SPR_BOOKE_IVORxx (-1) in register_BookE_sprs()
862 (i == 2 && (env->insns_flags & PPC_64B)) in register_BookE206_sprs()
867 if (env->nb_pids > 1) { in register_BookE206_sprs()
873 if (env->nb_pids > 2) { in register_BookE206_sprs()
893 switch (env->nb_ways) { in register_BookE206_sprs()
1635 * HEIR => SPR 339 (Power 2.05 hypv) (64-bit reg from 3.1)
1637 * perf => 768-783 (Power 2.04)
1638 * perf => 784-799 (Power 2.04)
1650 env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000100; in init_excp_4xx()
1651 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_4xx()
1652 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_4xx()
1653 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_4xx()
1654 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_4xx()
1655 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_4xx()
1656 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_4xx()
1657 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_4xx()
1658 env->excp_vectors[POWERPC_EXCP_PIT] = 0x00001000; in init_excp_4xx()
1659 env->excp_vectors[POWERPC_EXCP_FIT] = 0x00001010; in init_excp_4xx()
1660 env->excp_vectors[POWERPC_EXCP_WDT] = 0x00001020; in init_excp_4xx()
1661 env->excp_vectors[POWERPC_EXCP_DTLB] = 0x00001100; in init_excp_4xx()
1662 env->excp_vectors[POWERPC_EXCP_ITLB] = 0x00001200; in init_excp_4xx()
1663 env->excp_vectors[POWERPC_EXCP_DEBUG] = 0x00002000; in init_excp_4xx()
1664 env->ivor_mask = 0x0000FFF0UL; in init_excp_4xx()
1665 env->ivpr_mask = 0xFFFF0000UL; in init_excp_4xx()
1667 env->hreset_vector = 0xFFFFFFFCUL; in init_excp_4xx()
1674 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_MPC5xx()
1675 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_MPC5xx()
1676 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_MPC5xx()
1677 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_MPC5xx()
1678 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_MPC5xx()
1679 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_MPC5xx()
1680 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_MPC5xx()
1681 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_MPC5xx()
1682 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_MPC5xx()
1683 env->excp_vectors[POWERPC_EXCP_FPA] = 0x00000E00; in init_excp_MPC5xx()
1684 env->excp_vectors[POWERPC_EXCP_EMUL] = 0x00001000; in init_excp_MPC5xx()
1685 env->excp_vectors[POWERPC_EXCP_DABR] = 0x00001C00; in init_excp_MPC5xx()
1686 env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001C00; in init_excp_MPC5xx()
1687 env->excp_vectors[POWERPC_EXCP_MEXTBR] = 0x00001E00; in init_excp_MPC5xx()
1688 env->excp_vectors[POWERPC_EXCP_NMEXTBR] = 0x00001F00; in init_excp_MPC5xx()
1689 env->ivor_mask = 0x0000FFF0UL; in init_excp_MPC5xx()
1690 env->ivpr_mask = 0xFFFF0000UL; in init_excp_MPC5xx()
1692 env->hreset_vector = 0x00000100UL; in init_excp_MPC5xx()
1699 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_MPC8xx()
1700 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_MPC8xx()
1701 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_MPC8xx()
1702 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_MPC8xx()
1703 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_MPC8xx()
1704 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_MPC8xx()
1705 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_MPC8xx()
1706 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_MPC8xx()
1707 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_MPC8xx()
1708 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_MPC8xx()
1709 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_MPC8xx()
1710 env->excp_vectors[POWERPC_EXCP_FPA] = 0x00000E00; in init_excp_MPC8xx()
1711 env->excp_vectors[POWERPC_EXCP_EMUL] = 0x00001000; in init_excp_MPC8xx()
1712 env->excp_vectors[POWERPC_EXCP_ITLB] = 0x00001100; in init_excp_MPC8xx()
1713 env->excp_vectors[POWERPC_EXCP_DTLB] = 0x00001200; in init_excp_MPC8xx()
1714 env->excp_vectors[POWERPC_EXCP_ITLBE] = 0x00001300; in init_excp_MPC8xx()
1715 env->excp_vectors[POWERPC_EXCP_DTLBE] = 0x00001400; in init_excp_MPC8xx()
1716 env->excp_vectors[POWERPC_EXCP_DABR] = 0x00001C00; in init_excp_MPC8xx()
1717 env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001C00; in init_excp_MPC8xx()
1718 env->excp_vectors[POWERPC_EXCP_MEXTBR] = 0x00001E00; in init_excp_MPC8xx()
1719 env->excp_vectors[POWERPC_EXCP_NMEXTBR] = 0x00001F00; in init_excp_MPC8xx()
1720 env->ivor_mask = 0x0000FFF0UL; in init_excp_MPC8xx()
1721 env->ivpr_mask = 0xFFFF0000UL; in init_excp_MPC8xx()
1723 env->hreset_vector = 0x00000100UL; in init_excp_MPC8xx()
1730 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_G2()
1731 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_G2()
1732 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_G2()
1733 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_G2()
1734 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_G2()
1735 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_G2()
1736 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_G2()
1737 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_G2()
1738 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_G2()
1739 env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000A00; in init_excp_G2()
1740 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_G2()
1741 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_G2()
1742 env->excp_vectors[POWERPC_EXCP_IFTLB] = 0x00001000; in init_excp_G2()
1743 env->excp_vectors[POWERPC_EXCP_DLTLB] = 0x00001100; in init_excp_G2()
1744 env->excp_vectors[POWERPC_EXCP_DSTLB] = 0x00001200; in init_excp_G2()
1745 env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300; in init_excp_G2()
1746 env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400; in init_excp_G2()
1748 env->hreset_vector = 0x00000100UL; in init_excp_G2()
1755 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000FFC; in init_excp_e200()
1756 env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000000; in init_excp_e200()
1757 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000000; in init_excp_e200()
1758 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000000; in init_excp_e200()
1759 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000000; in init_excp_e200()
1760 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000000; in init_excp_e200()
1761 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000000; in init_excp_e200()
1762 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000000; in init_excp_e200()
1763 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000000; in init_excp_e200()
1764 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000000; in init_excp_e200()
1765 env->excp_vectors[POWERPC_EXCP_APU] = 0x00000000; in init_excp_e200()
1766 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000000; in init_excp_e200()
1767 env->excp_vectors[POWERPC_EXCP_FIT] = 0x00000000; in init_excp_e200()
1768 env->excp_vectors[POWERPC_EXCP_WDT] = 0x00000000; in init_excp_e200()
1769 env->excp_vectors[POWERPC_EXCP_DTLB] = 0x00000000; in init_excp_e200()
1770 env->excp_vectors[POWERPC_EXCP_ITLB] = 0x00000000; in init_excp_e200()
1771 env->excp_vectors[POWERPC_EXCP_DEBUG] = 0x00000000; in init_excp_e200()
1777 env->excp_vectors[POWERPC_EXCP_SPEU] = 0x00000000; in init_excp_e200()
1778 env->excp_vectors[POWERPC_EXCP_EFPDI] = 0x00000000; in init_excp_e200()
1780 env->excp_vectors[POWERPC_EXCP_EFPRI] = 0x00000000; in init_excp_e200()
1781 env->ivor_mask = 0x0000FFF7UL; in init_excp_e200()
1782 env->ivpr_mask = ivpr_mask; in init_excp_e200()
1784 env->hreset_vector = 0xFFFFFFFCUL; in init_excp_e200()
1791 env->excp_vectors[POWERPC_EXCP_CRITICAL] = 0x00000000; in init_excp_BookE()
1792 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000000; in init_excp_BookE()
1793 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000000; in init_excp_BookE()
1794 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000000; in init_excp_BookE()
1795 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000000; in init_excp_BookE()
1796 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000000; in init_excp_BookE()
1797 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000000; in init_excp_BookE()
1798 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000000; in init_excp_BookE()
1799 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000000; in init_excp_BookE()
1800 env->excp_vectors[POWERPC_EXCP_APU] = 0x00000000; in init_excp_BookE()
1801 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000000; in init_excp_BookE()
1802 env->excp_vectors[POWERPC_EXCP_FIT] = 0x00000000; in init_excp_BookE()
1803 env->excp_vectors[POWERPC_EXCP_WDT] = 0x00000000; in init_excp_BookE()
1804 env->excp_vectors[POWERPC_EXCP_DTLB] = 0x00000000; in init_excp_BookE()
1805 env->excp_vectors[POWERPC_EXCP_ITLB] = 0x00000000; in init_excp_BookE()
1806 env->excp_vectors[POWERPC_EXCP_DEBUG] = 0x00000000; in init_excp_BookE()
1807 env->ivor_mask = 0x0000FFF0UL; in init_excp_BookE()
1808 env->ivpr_mask = 0xFFFF0000UL; in init_excp_BookE()
1810 env->hreset_vector = 0xFFFFFFFCUL; in init_excp_BookE()
1817 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_603()
1818 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_603()
1819 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_603()
1820 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_603()
1821 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_603()
1822 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_603()
1823 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_603()
1824 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_603()
1825 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_603()
1826 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_603()
1827 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_603()
1828 env->excp_vectors[POWERPC_EXCP_IFTLB] = 0x00001000; in init_excp_603()
1829 env->excp_vectors[POWERPC_EXCP_DLTLB] = 0x00001100; in init_excp_603()
1830 env->excp_vectors[POWERPC_EXCP_DSTLB] = 0x00001200; in init_excp_603()
1831 env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300; in init_excp_603()
1832 env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400; in init_excp_603()
1834 env->hreset_vector = 0x00000100UL; in init_excp_603()
1841 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_604()
1842 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_604()
1843 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_604()
1844 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_604()
1845 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_604()
1846 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_604()
1847 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_604()
1848 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_604()
1849 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_604()
1850 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_604()
1851 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_604()
1852 env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00; in init_excp_604()
1853 env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300; in init_excp_604()
1854 env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400; in init_excp_604()
1856 env->hreset_vector = 0x00000100UL; in init_excp_604()
1863 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_7x0()
1864 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_7x0()
1865 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_7x0()
1866 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_7x0()
1867 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_7x0()
1868 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_7x0()
1869 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_7x0()
1870 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_7x0()
1871 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_7x0()
1872 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_7x0()
1873 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_7x0()
1874 env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00; in init_excp_7x0()
1875 env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300; in init_excp_7x0()
1876 env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400; in init_excp_7x0()
1877 env->excp_vectors[POWERPC_EXCP_THERM] = 0x00001700; in init_excp_7x0()
1879 env->hreset_vector = 0x00000100UL; in init_excp_7x0()
1886 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_750cl()
1887 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_750cl()
1888 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_750cl()
1889 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_750cl()
1890 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_750cl()
1891 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_750cl()
1892 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_750cl()
1893 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_750cl()
1894 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_750cl()
1895 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_750cl()
1896 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_750cl()
1897 env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00; in init_excp_750cl()
1898 env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300; in init_excp_750cl()
1899 env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400; in init_excp_750cl()
1901 env->hreset_vector = 0x00000100UL; in init_excp_750cl()
1908 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_750cx()
1909 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_750cx()
1910 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_750cx()
1911 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_750cx()
1912 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_750cx()
1913 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_750cx()
1914 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_750cx()
1915 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_750cx()
1916 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_750cx()
1917 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_750cx()
1918 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_750cx()
1919 env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00; in init_excp_750cx()
1920 env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300; in init_excp_750cx()
1921 env->excp_vectors[POWERPC_EXCP_THERM] = 0x00001700; in init_excp_750cx()
1923 env->hreset_vector = 0x00000100UL; in init_excp_750cx()
1931 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_7x5()
1932 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_7x5()
1933 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_7x5()
1934 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_7x5()
1935 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_7x5()
1936 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_7x5()
1937 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_7x5()
1938 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_7x5()
1939 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_7x5()
1940 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_7x5()
1941 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_7x5()
1942 env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00; in init_excp_7x5()
1943 env->excp_vectors[POWERPC_EXCP_IFTLB] = 0x00001000; in init_excp_7x5()
1944 env->excp_vectors[POWERPC_EXCP_DLTLB] = 0x00001100; in init_excp_7x5()
1945 env->excp_vectors[POWERPC_EXCP_DSTLB] = 0x00001200; in init_excp_7x5()
1946 env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300; in init_excp_7x5()
1947 env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400; in init_excp_7x5()
1948 env->excp_vectors[POWERPC_EXCP_THERM] = 0x00001700; in init_excp_7x5()
1950 env->hreset_vector = 0x00000100UL; in init_excp_7x5()
1957 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_7400()
1958 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_7400()
1959 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_7400()
1960 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_7400()
1961 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_7400()
1962 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_7400()
1963 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_7400()
1964 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_7400()
1965 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_7400()
1966 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_7400()
1967 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_7400()
1968 env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00; in init_excp_7400()
1969 env->excp_vectors[POWERPC_EXCP_VPU] = 0x00000F20; in init_excp_7400()
1970 env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300; in init_excp_7400()
1971 env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400; in init_excp_7400()
1972 env->excp_vectors[POWERPC_EXCP_VPUA] = 0x00001600; in init_excp_7400()
1973 env->excp_vectors[POWERPC_EXCP_THERM] = 0x00001700; in init_excp_7400()
1975 env->hreset_vector = 0x00000100UL; in init_excp_7400()
1982 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_7450()
1983 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_7450()
1984 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_7450()
1985 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_7450()
1986 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_7450()
1987 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_7450()
1988 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_7450()
1989 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_7450()
1990 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_7450()
1991 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_7450()
1992 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_7450()
1993 env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00; in init_excp_7450()
1994 env->excp_vectors[POWERPC_EXCP_VPU] = 0x00000F20; in init_excp_7450()
1995 env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300; in init_excp_7450()
1996 env->excp_vectors[POWERPC_EXCP_SMI] = 0x00001400; in init_excp_7450()
1997 env->excp_vectors[POWERPC_EXCP_VPUA] = 0x00001600; in init_excp_7450()
1999 env->hreset_vector = 0x00000100UL; in init_excp_7450()
2007 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_970()
2008 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_970()
2009 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_970()
2010 env->excp_vectors[POWERPC_EXCP_DSEG] = 0x00000380; in init_excp_970()
2011 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_970()
2012 env->excp_vectors[POWERPC_EXCP_ISEG] = 0x00000480; in init_excp_970()
2013 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_970()
2014 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_970()
2015 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_970()
2016 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_970()
2017 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_970()
2018 env->excp_vectors[POWERPC_EXCP_HDECR] = 0x00000980; in init_excp_970()
2019 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_970()
2020 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_970()
2021 env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00; in init_excp_970()
2022 env->excp_vectors[POWERPC_EXCP_VPU] = 0x00000F20; in init_excp_970()
2023 env->excp_vectors[POWERPC_EXCP_IABR] = 0x00001300; in init_excp_970()
2024 env->excp_vectors[POWERPC_EXCP_MAINT] = 0x00001600; in init_excp_970()
2025 env->excp_vectors[POWERPC_EXCP_VPUA] = 0x00001700; in init_excp_970()
2026 env->excp_vectors[POWERPC_EXCP_THERM] = 0x00001800; in init_excp_970()
2028 env->hreset_vector = 0x0000000000000100ULL; in init_excp_970()
2035 env->excp_vectors[POWERPC_EXCP_RESET] = 0x00000100; in init_excp_POWER7()
2036 env->excp_vectors[POWERPC_EXCP_MCHECK] = 0x00000200; in init_excp_POWER7()
2037 env->excp_vectors[POWERPC_EXCP_DSI] = 0x00000300; in init_excp_POWER7()
2038 env->excp_vectors[POWERPC_EXCP_DSEG] = 0x00000380; in init_excp_POWER7()
2039 env->excp_vectors[POWERPC_EXCP_ISI] = 0x00000400; in init_excp_POWER7()
2040 env->excp_vectors[POWERPC_EXCP_ISEG] = 0x00000480; in init_excp_POWER7()
2041 env->excp_vectors[POWERPC_EXCP_EXTERNAL] = 0x00000500; in init_excp_POWER7()
2042 env->excp_vectors[POWERPC_EXCP_ALIGN] = 0x00000600; in init_excp_POWER7()
2043 env->excp_vectors[POWERPC_EXCP_PROGRAM] = 0x00000700; in init_excp_POWER7()
2044 env->excp_vectors[POWERPC_EXCP_FPU] = 0x00000800; in init_excp_POWER7()
2045 env->excp_vectors[POWERPC_EXCP_DECR] = 0x00000900; in init_excp_POWER7()
2046 env->excp_vectors[POWERPC_EXCP_HDECR] = 0x00000980; in init_excp_POWER7()
2047 env->excp_vectors[POWERPC_EXCP_SYSCALL] = 0x00000C00; in init_excp_POWER7()
2048 env->excp_vectors[POWERPC_EXCP_TRACE] = 0x00000D00; in init_excp_POWER7()
2049 env->excp_vectors[POWERPC_EXCP_HDSI] = 0x00000E00; in init_excp_POWER7()
2050 env->excp_vectors[POWERPC_EXCP_HISI] = 0x00000E20; in init_excp_POWER7()
2051 env->excp_vectors[POWERPC_EXCP_HV_EMU] = 0x00000E40; in init_excp_POWER7()
2052 env->excp_vectors[POWERPC_EXCP_HV_MAINT] = 0x00000E60; in init_excp_POWER7()
2053 env->excp_vectors[POWERPC_EXCP_PERFM] = 0x00000F00; in init_excp_POWER7()
2054 env->excp_vectors[POWERPC_EXCP_VPU] = 0x00000F20; in init_excp_POWER7()
2055 env->excp_vectors[POWERPC_EXCP_VSXU] = 0x00000F40; in init_excp_POWER7()
2057 env->hreset_vector = 0x0000000000000100ULL; in init_excp_POWER7()
2066 env->excp_vectors[POWERPC_EXCP_SDOOR] = 0x00000A00; in init_excp_POWER8()
2067 env->excp_vectors[POWERPC_EXCP_FU] = 0x00000F60; in init_excp_POWER8()
2068 env->excp_vectors[POWERPC_EXCP_HV_FU] = 0x00000F80; in init_excp_POWER8()
2069 env->excp_vectors[POWERPC_EXCP_SDOOR_HV] = 0x00000E80; in init_excp_POWER8()
2072 env->excp_vectors[POWERPC_EXCP_PERFM_EBB] = 0x0; in init_excp_POWER8()
2073 env->excp_vectors[POWERPC_EXCP_EXTERNAL_EBB] = 0x0; in init_excp_POWER8()
2082 env->excp_vectors[POWERPC_EXCP_HVIRT] = 0x00000EA0; in init_excp_POWER9()
2083 env->excp_vectors[POWERPC_EXCP_SYSCALL_VECTORED] = 0x00017000; in init_excp_POWER9()
2096 if (env->spr[SPR_HID0] & 0x00E00000) { in check_pow_hid0()
2105 if (env->spr[SPR_HID0] & 0x00600000) { in check_pow_hid0_74xx()
2115 if (env->spr[SPR_HID0] & HID0_ENABLE_ATTN) { in check_attn_hid0()
2124 if (env->spr[SPR_HID0] & HID0_POWER9_ENABLE_ATTN) { in check_attn_hid0_power9()
2135 env->nb_tlb = 64; in init_tlbs_emb()
2136 env->nb_ways = 1; in init_tlbs_emb()
2137 env->tlb_type = TLB_EMB; in init_tlbs_emb()
2149 env->dcache_line_size = 32; in init_proc_405()
2150 env->icache_line_size = 32; in init_proc_405()
2163 dc->desc = "PowerPC 405";
2164 pcc->init_proc = init_proc_405;
2165 pcc->check_pow = check_pow_nocheck;
2166 pcc->check_attn = check_attn_none;
2167 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
2174 pcc->msr_mask = (1ull << MSR_WE) |
2184 pcc->mmu_model = POWERPC_MMU_SOFT_4xx;
2185 pcc->excp_model = POWERPC_EXCP_40x;
2186 pcc->bus_model = PPC_FLAGS_INPUT_405;
2187 pcc->bfd_mach = bfd_mach_ppc_403;
2188 pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
2218 env->dcache_line_size = 32; in init_proc_440EP()
2219 env->icache_line_size = 32; in init_proc_440EP()
2231 dc->desc = "PowerPC 440 EP";
2232 pcc->init_proc = init_proc_440EP;
2233 pcc->check_pow = check_pow_nocheck;
2234 pcc->check_attn = check_attn_none;
2235 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
2245 pcc->msr_mask = (1ull << MSR_POW) |
2257 pcc->mmu_model = POWERPC_MMU_BOOKE;
2258 pcc->excp_model = POWERPC_EXCP_BOOKE;
2259 pcc->bus_model = PPC_FLAGS_INPUT_BookE;
2260 pcc->bfd_mach = bfd_mach_ppc_403;
2261 pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
2270 dc->desc = "PowerPC 460 EX";
2271 pcc->init_proc = init_proc_440EP;
2272 pcc->check_pow = check_pow_nocheck;
2273 pcc->check_attn = check_attn_none;
2274 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
2284 pcc->msr_mask = (1ull << MSR_POW) |
2296 pcc->mmu_model = POWERPC_MMU_BOOKE;
2297 pcc->excp_model = POWERPC_EXCP_BOOKE;
2298 pcc->bus_model = PPC_FLAGS_INPUT_BookE;
2299 pcc->bfd_mach = bfd_mach_ppc_403;
2300 pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
2312 env->dcache_line_size = 32; in init_proc_440GP()
2313 env->icache_line_size = 32; in init_proc_440GP()
2325 dc->desc = "PowerPC 440 GP";
2326 pcc->init_proc = init_proc_440GP;
2327 pcc->check_pow = check_pow_nocheck;
2328 pcc->check_attn = check_attn_none;
2329 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
2336 pcc->msr_mask = (1ull << MSR_POW) |
2348 pcc->mmu_model = POWERPC_MMU_BOOKE;
2349 pcc->excp_model = POWERPC_EXCP_BOOKE;
2350 pcc->bus_model = PPC_FLAGS_INPUT_BookE;
2351 pcc->bfd_mach = bfd_mach_ppc_403;
2352 pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
2382 env->dcache_line_size = 32; in init_proc_440x5()
2383 env->icache_line_size = 32; in init_proc_440x5()
2395 dc->desc = "PowerPC 440x5";
2396 pcc->init_proc = init_proc_440x5;
2397 pcc->check_pow = check_pow_nocheck;
2398 pcc->check_attn = check_attn_none;
2399 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
2406 pcc->msr_mask = (1ull << MSR_POW) |
2418 pcc->mmu_model = POWERPC_MMU_BOOKE;
2419 pcc->excp_model = POWERPC_EXCP_BOOKE;
2420 pcc->bus_model = PPC_FLAGS_INPUT_BookE;
2421 pcc->bfd_mach = bfd_mach_ppc_403;
2422 pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
2431 dc->desc = "PowerPC 440x5 with double precision FPU";
2432 pcc->init_proc = init_proc_440x5;
2433 pcc->check_pow = check_pow_nocheck;
2434 pcc->check_attn = check_attn_none;
2435 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING |
2444 pcc->insns_flags2 = PPC2_FP_CVT_S64;
2445 pcc->msr_mask = (1ull << MSR_POW) |
2457 pcc->mmu_model = POWERPC_MMU_BOOKE;
2458 pcc->excp_model = POWERPC_EXCP_BOOKE;
2459 pcc->bus_model = PPC_FLAGS_INPUT_BookE;
2460 pcc->bfd_mach = bfd_mach_ppc_403;
2461 pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DWE |
2470 env->dcache_line_size = 32; in init_proc_MPC5xx()
2471 env->icache_line_size = 32; in init_proc_MPC5xx()
2480 dc->desc = "Freescale 5xx cores (aka RCPU)"; in POWERPC_FAMILY()
2481 pcc->init_proc = init_proc_MPC5xx; in POWERPC_FAMILY()
2482 pcc->check_pow = check_pow_none; in POWERPC_FAMILY()
2483 pcc->check_attn = check_attn_none; in POWERPC_FAMILY()
2484 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | in POWERPC_FAMILY()
2488 pcc->msr_mask = (1ull << MSR_ILE) | in POWERPC_FAMILY()
2500 pcc->mmu_model = POWERPC_MMU_REAL; in POWERPC_FAMILY()
2501 pcc->excp_model = POWERPC_EXCP_6xx; in POWERPC_FAMILY()
2502 pcc->bus_model = PPC_FLAGS_INPUT_RCPU; in POWERPC_FAMILY()
2503 pcc->bfd_mach = bfd_mach_ppc_505; in POWERPC_FAMILY()
2504 pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE | in POWERPC_FAMILY()
2513 env->dcache_line_size = 32; in init_proc_MPC8xx()
2514 env->icache_line_size = 32; in init_proc_MPC8xx()
2523 dc->desc = "Freescale 8xx cores (aka PowerQUICC)"; in POWERPC_FAMILY()
2524 pcc->init_proc = init_proc_MPC8xx; in POWERPC_FAMILY()
2525 pcc->check_pow = check_pow_none; in POWERPC_FAMILY()
2526 pcc->check_attn = check_attn_none; in POWERPC_FAMILY()
2527 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | in POWERPC_FAMILY()
2530 pcc->msr_mask = (1ull << MSR_ILE) | in POWERPC_FAMILY()
2542 pcc->mmu_model = POWERPC_MMU_MPC8xx; in POWERPC_FAMILY()
2543 pcc->excp_model = POWERPC_EXCP_6xx; in POWERPC_FAMILY()
2544 pcc->bus_model = PPC_FLAGS_INPUT_RCPU; in POWERPC_FAMILY()
2545 pcc->bfd_mach = bfd_mach_ppc_860; in POWERPC_FAMILY()
2546 pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE | in POWERPC_FAMILY()
2550 /* Freescale 82xx cores (aka PowerQUICC-II) */
2563 env->dcache_line_size = 32; in init_proc_G2()
2564 env->icache_line_size = 32; in init_proc_G2()
2574 dc->desc = "PowerPC G2"; in POWERPC_FAMILY()
2575 pcc->init_proc = init_proc_G2; in POWERPC_FAMILY()
2576 pcc->check_pow = check_pow_hid0; in POWERPC_FAMILY()
2577 pcc->check_attn = check_attn_none; in POWERPC_FAMILY()
2578 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB | in POWERPC_FAMILY()
2585 pcc->msr_mask = (1ull << MSR_POW) | in POWERPC_FAMILY()
2600 pcc->mmu_model = POWERPC_MMU_SOFT_6xx; in POWERPC_FAMILY()
2601 pcc->excp_model = POWERPC_EXCP_6xx; in POWERPC_FAMILY()
2602 pcc->bus_model = PPC_FLAGS_INPUT_6xx; in POWERPC_FAMILY()
2603 pcc->bfd_mach = bfd_mach_ppc_ec603e; in POWERPC_FAMILY()
2604 pcc->flags = POWERPC_FLAG_TGPR | POWERPC_FLAG_SE | in POWERPC_FAMILY()
2613 dc->desc = "PowerPC G2LE"; in POWERPC_FAMILY()
2614 pcc->init_proc = init_proc_G2; in POWERPC_FAMILY()
2615 pcc->check_pow = check_pow_hid0; in POWERPC_FAMILY()
2616 pcc->check_attn = check_attn_none; in POWERPC_FAMILY()
2617 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB | in POWERPC_FAMILY()
2624 pcc->msr_mask = (1ull << MSR_POW) | in POWERPC_FAMILY()
2641 pcc->mmu_model = POWERPC_MMU_SOFT_6xx; in POWERPC_FAMILY()
2642 pcc->excp_model = POWERPC_EXCP_6xx; in POWERPC_FAMILY()
2643 pcc->bus_model = PPC_FLAGS_INPUT_6xx; in POWERPC_FAMILY()
2644 pcc->bfd_mach = bfd_mach_ppc_ec603e; in POWERPC_FAMILY()
2645 pcc->flags = POWERPC_FLAG_TGPR | POWERPC_FLAG_SE | in POWERPC_FAMILY()
2746 env->dcache_line_size = 32; in init_proc_e200()
2747 env->icache_line_size = 32; in init_proc_e200()
2756 dc->desc = "e200 core"; in POWERPC_FAMILY()
2757 pcc->init_proc = init_proc_e200; in POWERPC_FAMILY()
2758 pcc->check_pow = check_pow_hid0; in POWERPC_FAMILY()
2759 pcc->check_attn = check_attn_none; in POWERPC_FAMILY()
2768 * all SPE multiply-accumulate instructions in POWERPC_FAMILY()
2770 pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | in POWERPC_FAMILY()
2777 pcc->msr_mask = (1ull << MSR_UCLE) | in POWERPC_FAMILY()
2791 pcc->mmu_model = POWERPC_MMU_BOOKE206; in POWERPC_FAMILY()
2792 pcc->excp_model = POWERPC_EXCP_BOOKE; in POWERPC_FAMILY()
2793 pcc->bus_model = PPC_FLAGS_INPUT_BookE; in POWERPC_FAMILY()
2794 pcc->bfd_mach = bfd_mach_ppc_860; in POWERPC_FAMILY()
2795 pcc->flags = POWERPC_FLAG_SPE | POWERPC_FLAG_CE | in POWERPC_FAMILY()
2860 env->nb_pids = 3; in init_proc_e500()
2861 env->nb_ways = 2; in init_proc_e500()
2878 env->nb_pids = 1; in init_proc_e500()
2884 env->spr[SPR_PVR]); in init_proc_e500()
2891 env->dcache_line_size = 32; in init_proc_e500()
2892 env->icache_line_size = 32; in init_proc_e500()
2896 env->dcache_line_size = 64; in init_proc_e500()
2897 env->icache_line_size = 64; in init_proc_e500()
2902 env->dcache_line_size = 32; in init_proc_e500()
2903 env->icache_line_size = 32; in init_proc_e500()
2909 env->spr[SPR_PVR]); in init_proc_e500()
3022 env->nb_tlb = 0; in init_proc_e500()
3023 env->tlb_type = TLB_MAS; in init_proc_e500()
3025 env->nb_tlb += booke206_tlb_size(env, i); in init_proc_e500()
3044 dc->desc = "e500v1 core"; in POWERPC_FAMILY()
3045 pcc->init_proc = init_proc_e500v1; in POWERPC_FAMILY()
3046 pcc->check_pow = check_pow_hid0; in POWERPC_FAMILY()
3047 pcc->check_attn = check_attn_none; in POWERPC_FAMILY()
3048 pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | in POWERPC_FAMILY()
3054 pcc->insns_flags2 = PPC2_BOOKE206; in POWERPC_FAMILY()
3055 pcc->msr_mask = (1ull << MSR_UCLE) | in POWERPC_FAMILY()
3069 pcc->mmu_model = POWERPC_MMU_BOOKE206; in POWERPC_FAMILY()
3070 pcc->excp_model = POWERPC_EXCP_BOOKE; in POWERPC_FAMILY()
3071 pcc->bus_model = PPC_FLAGS_INPUT_BookE; in POWERPC_FAMILY()
3072 pcc->bfd_mach = bfd_mach_ppc_860; in POWERPC_FAMILY()
3073 pcc->flags = POWERPC_FLAG_SPE | POWERPC_FLAG_CE | in POWERPC_FAMILY()
3088 dc->desc = "e500v2 core"; in POWERPC_FAMILY()
3089 pcc->init_proc = init_proc_e500v2; in POWERPC_FAMILY()
3090 pcc->check_pow = check_pow_hid0; in POWERPC_FAMILY()
3091 pcc->check_attn = check_attn_none; in POWERPC_FAMILY()
3092 pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | in POWERPC_FAMILY()
3098 pcc->insns_flags2 = PPC2_BOOKE206; in POWERPC_FAMILY()
3099 pcc->msr_mask = (1ull << MSR_UCLE) | in POWERPC_FAMILY()
3113 pcc->mmu_model = POWERPC_MMU_BOOKE206; in POWERPC_FAMILY()
3114 pcc->excp_model = POWERPC_EXCP_BOOKE; in POWERPC_FAMILY()
3115 pcc->bus_model = PPC_FLAGS_INPUT_BookE; in POWERPC_FAMILY()
3116 pcc->bfd_mach = bfd_mach_ppc_860; in POWERPC_FAMILY()
3117 pcc->flags = POWERPC_FLAG_SPE | POWERPC_FLAG_CE | in POWERPC_FAMILY()
3132 dc->desc = "e500mc core"; in POWERPC_FAMILY()
3133 pcc->init_proc = init_proc_e500mc; in POWERPC_FAMILY()
3134 pcc->check_pow = check_pow_none; in POWERPC_FAMILY()
3135 pcc->check_attn = check_attn_none; in POWERPC_FAMILY()
3136 pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_MFTB | in POWERPC_FAMILY()
3144 pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL; in POWERPC_FAMILY()
3145 pcc->msr_mask = (1ull << MSR_GS) | in POWERPC_FAMILY()
3159 pcc->mmu_model = POWERPC_MMU_BOOKE206; in POWERPC_FAMILY()
3160 pcc->excp_model = POWERPC_EXCP_BOOKE; in POWERPC_FAMILY()
3161 pcc->bus_model = PPC_FLAGS_INPUT_BookE; in POWERPC_FAMILY()
3163 pcc->bfd_mach = bfd_mach_ppc_e500; in POWERPC_FAMILY()
3164 pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DE | in POWERPC_FAMILY()
3179 dc->desc = "e5500 core"; in POWERPC_FAMILY()
3180 pcc->init_proc = init_proc_e5500; in POWERPC_FAMILY()
3181 pcc->check_pow = check_pow_none; in POWERPC_FAMILY()
3182 pcc->check_attn = check_attn_none; in POWERPC_FAMILY()
3183 pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_MFTB | in POWERPC_FAMILY()
3192 pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 | in POWERPC_FAMILY()
3194 pcc->msr_mask = (1ull << MSR_CM) | in POWERPC_FAMILY()
3209 pcc->mmu_model = POWERPC_MMU_BOOKE206; in POWERPC_FAMILY()
3210 pcc->excp_model = POWERPC_EXCP_BOOKE; in POWERPC_FAMILY()
3211 pcc->bus_model = PPC_FLAGS_INPUT_BookE; in POWERPC_FAMILY()
3213 pcc->bfd_mach = bfd_mach_ppc_e500; in POWERPC_FAMILY()
3214 pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DE | in POWERPC_FAMILY()
3228 dc->desc = "e6500 core"; in POWERPC_FAMILY()
3229 pcc->init_proc = init_proc_e6500; in POWERPC_FAMILY()
3230 pcc->check_pow = check_pow_none; in POWERPC_FAMILY()
3231 pcc->check_attn = check_attn_none; in POWERPC_FAMILY()
3232 pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_MFTB | in POWERPC_FAMILY()
3241 pcc->insns_flags2 = PPC2_BOOKE206 | PPC2_PRCNTL | PPC2_PERM_ISA206 | in POWERPC_FAMILY()
3243 pcc->msr_mask = (1ull << MSR_CM) | in POWERPC_FAMILY()
3259 pcc->mmu_model = POWERPC_MMU_BOOKE206; in POWERPC_FAMILY()
3260 pcc->excp_model = POWERPC_EXCP_BOOKE; in POWERPC_FAMILY()
3261 pcc->bus_model = PPC_FLAGS_INPUT_BookE; in POWERPC_FAMILY()
3262 pcc->bfd_mach = bfd_mach_ppc_e500; in POWERPC_FAMILY()
3263 pcc->flags = POWERPC_FLAG_CE | POWERPC_FLAG_DE | in POWERPC_FAMILY()
3269 /* Non-embedded PowerPC */
3280 env->dcache_line_size = 32; in init_proc_603()
3281 env->icache_line_size = 32; in init_proc_603()
3291 dc->desc = "PowerPC 603";
3292 pcc->init_proc = init_proc_603;
3293 pcc->check_pow = check_pow_hid0;
3294 pcc->check_attn = check_attn_none;
3295 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
3302 pcc->msr_mask = (1ull << MSR_POW) |
3318 pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
3319 pcc->excp_model = POWERPC_EXCP_6xx;
3320 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
3321 pcc->bfd_mach = bfd_mach_ppc_603;
3322 pcc->flags = POWERPC_FLAG_TGPR | POWERPC_FLAG_SE |
3331 dc->desc = "PowerPC 603e";
3332 pcc->init_proc = init_proc_603;
3333 pcc->check_pow = check_pow_hid0;
3334 pcc->check_attn = check_attn_none;
3335 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
3342 pcc->msr_mask = (1ull << MSR_POW) |
3358 pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
3359 pcc->excp_model = POWERPC_EXCP_6xx;
3360 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
3361 pcc->bfd_mach = bfd_mach_ppc_ec603e;
3362 pcc->flags = POWERPC_FLAG_TGPR | POWERPC_FLAG_SE |
3377 dc->desc = "e300 core"; in POWERPC_FAMILY()
3378 pcc->init_proc = init_proc_e300; in POWERPC_FAMILY()
3379 pcc->check_pow = check_pow_hid0; in POWERPC_FAMILY()
3380 pcc->check_attn = check_attn_none; in POWERPC_FAMILY()
3381 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB | in POWERPC_FAMILY()
3388 pcc->msr_mask = (1ull << MSR_POW) | in POWERPC_FAMILY()
3405 pcc->mmu_model = POWERPC_MMU_SOFT_6xx; in POWERPC_FAMILY()
3406 pcc->excp_model = POWERPC_EXCP_6xx; in POWERPC_FAMILY()
3407 pcc->bus_model = PPC_FLAGS_INPUT_6xx; in POWERPC_FAMILY()
3408 pcc->bfd_mach = bfd_mach_ppc_603; in POWERPC_FAMILY()
3409 pcc->flags = POWERPC_FLAG_TGPR | POWERPC_FLAG_SE | in POWERPC_FAMILY()
3422 env->dcache_line_size = 32; in init_proc_604()
3423 env->icache_line_size = 32; in init_proc_604()
3433 dc->desc = "PowerPC 604";
3434 pcc->init_proc = init_proc_604;
3435 pcc->check_pow = check_pow_nocheck;
3436 pcc->check_attn = check_attn_none;
3437 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
3444 pcc->msr_mask = (1ull << MSR_POW) |
3460 pcc->mmu_model = POWERPC_MMU_32B;
3461 pcc->excp_model = POWERPC_EXCP_6xx;
3462 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
3463 pcc->bfd_mach = bfd_mach_ppc_604;
3464 pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
3479 dc->desc = "PowerPC 604E";
3480 pcc->init_proc = init_proc_604E;
3481 pcc->check_pow = check_pow_nocheck;
3482 pcc->check_attn = check_attn_none;
3483 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
3490 pcc->msr_mask = (1ull << MSR_POW) |
3506 pcc->mmu_model = POWERPC_MMU_32B;
3507 pcc->excp_model = POWERPC_EXCP_6xx;
3508 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
3509 pcc->bfd_mach = bfd_mach_ppc_604;
3510 pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
3525 env->dcache_line_size = 32; in init_proc_740()
3526 env->icache_line_size = 32; in init_proc_740()
3536 dc->desc = "PowerPC 740";
3537 pcc->init_proc = init_proc_740;
3538 pcc->check_pow = check_pow_hid0;
3539 pcc->check_attn = check_attn_none;
3540 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
3547 pcc->msr_mask = (1ull << MSR_POW) |
3563 pcc->mmu_model = POWERPC_MMU_32B;
3564 pcc->excp_model = POWERPC_EXCP_7xx;
3565 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
3566 pcc->bfd_mach = bfd_mach_ppc_750;
3567 pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
3591 env->dcache_line_size = 32; in init_proc_750()
3592 env->icache_line_size = 32; in init_proc_750()
3602 dc->desc = "PowerPC 750";
3603 pcc->init_proc = init_proc_750;
3604 pcc->check_pow = check_pow_hid0;
3605 pcc->check_attn = check_attn_none;
3606 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
3613 pcc->msr_mask = (1ull << MSR_POW) |
3629 pcc->mmu_model = POWERPC_MMU_32B;
3630 pcc->excp_model = POWERPC_EXCP_7xx;
3631 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
3632 pcc->bfd_mach = bfd_mach_ppc_750;
3633 pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
3738 env->dcache_line_size = 32; in init_proc_750cl()
3739 env->icache_line_size = 32; in init_proc_750cl()
3749 dc->desc = "PowerPC 750 CL";
3750 pcc->init_proc = init_proc_750cl;
3751 pcc->check_pow = check_pow_hid0;
3752 pcc->check_attn = check_attn_none;
3792 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
3799 pcc->msr_mask = (1ull << MSR_POW) |
3815 pcc->mmu_model = POWERPC_MMU_32B;
3816 pcc->excp_model = POWERPC_EXCP_7xx;
3817 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
3818 pcc->bfd_mach = bfd_mach_ppc_750;
3819 pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
3846 env->dcache_line_size = 32; in init_proc_750cx()
3847 env->icache_line_size = 32; in init_proc_750cx()
3857 dc->desc = "PowerPC 750CX";
3858 pcc->init_proc = init_proc_750cx;
3859 pcc->check_pow = check_pow_hid0;
3860 pcc->check_attn = check_attn_none;
3861 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
3868 pcc->msr_mask = (1ull << MSR_POW) |
3884 pcc->mmu_model = POWERPC_MMU_32B;
3885 pcc->excp_model = POWERPC_EXCP_7xx;
3886 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
3887 pcc->bfd_mach = bfd_mach_ppc_750;
3888 pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
3919 env->dcache_line_size = 32; in init_proc_750fx()
3920 env->icache_line_size = 32; in init_proc_750fx()
3930 dc->desc = "PowerPC 750FX";
3931 pcc->init_proc = init_proc_750fx;
3932 pcc->check_pow = check_pow_hid0;
3933 pcc->check_attn = check_attn_none;
3934 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
3941 pcc->msr_mask = (1ull << MSR_POW) |
3957 pcc->mmu_model = POWERPC_MMU_32B;
3958 pcc->excp_model = POWERPC_EXCP_7xx;
3959 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
3960 pcc->bfd_mach = bfd_mach_ppc_750;
3961 pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
3992 env->dcache_line_size = 32; in init_proc_750gx()
3993 env->icache_line_size = 32; in init_proc_750gx()
4003 dc->desc = "PowerPC 750GX";
4004 pcc->init_proc = init_proc_750gx;
4005 pcc->check_pow = check_pow_hid0;
4006 pcc->check_attn = check_attn_none;
4007 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
4014 pcc->msr_mask = (1ull << MSR_POW) |
4030 pcc->mmu_model = POWERPC_MMU_32B;
4031 pcc->excp_model = POWERPC_EXCP_7xx;
4032 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
4033 pcc->bfd_mach = bfd_mach_ppc_750;
4034 pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
4052 env->dcache_line_size = 32; in init_proc_745()
4053 env->icache_line_size = 32; in init_proc_745()
4063 dc->desc = "PowerPC 745";
4064 pcc->init_proc = init_proc_745;
4065 pcc->check_pow = check_pow_hid0;
4066 pcc->check_attn = check_attn_none;
4067 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
4074 pcc->msr_mask = (1ull << MSR_POW) |
4090 pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
4091 pcc->excp_model = POWERPC_EXCP_7xx;
4092 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
4093 pcc->bfd_mach = bfd_mach_ppc_750;
4094 pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
4109 dc->desc = "PowerPC 755";
4110 pcc->init_proc = init_proc_755;
4111 pcc->check_pow = check_pow_hid0;
4112 pcc->check_attn = check_attn_none;
4113 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
4120 pcc->msr_mask = (1ull << MSR_POW) |
4136 pcc->mmu_model = POWERPC_MMU_SOFT_6xx;
4137 pcc->excp_model = POWERPC_EXCP_7xx;
4138 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
4139 pcc->bfd_mach = bfd_mach_ppc_750;
4140 pcc->flags = POWERPC_FLAG_SE | POWERPC_FLAG_BE |
4165 env->dcache_line_size = 32; in init_proc_7400()
4166 env->icache_line_size = 32; in init_proc_7400()
4176 dc->desc = "PowerPC 7400 (aka G4)";
4177 pcc->init_proc = init_proc_7400;
4178 pcc->check_pow = check_pow_hid0;
4179 pcc->check_attn = check_attn_none;
4180 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
4191 pcc->msr_mask = (1ull << MSR_VR) |
4208 pcc->mmu_model = POWERPC_MMU_32B;
4209 pcc->excp_model = POWERPC_EXCP_74xx;
4210 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
4211 pcc->bfd_mach = bfd_mach_ppc_7400;
4212 pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
4245 env->dcache_line_size = 32; in init_proc_7410()
4246 env->icache_line_size = 32; in init_proc_7410()
4256 dc->desc = "PowerPC 7410 (aka G4)";
4257 pcc->init_proc = init_proc_7410;
4258 pcc->check_pow = check_pow_hid0;
4259 pcc->check_attn = check_attn_none;
4260 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
4271 pcc->msr_mask = (1ull << MSR_VR) |
4288 pcc->mmu_model = POWERPC_MMU_32B;
4289 pcc->excp_model = POWERPC_EXCP_74xx;
4290 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
4291 pcc->bfd_mach = bfd_mach_ppc_7400;
4292 pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
4346 env->dcache_line_size = 32; in init_proc_7440()
4347 env->icache_line_size = 32; in init_proc_7440()
4357 dc->desc = "PowerPC 7440 (aka G4)";
4358 pcc->init_proc = init_proc_7440;
4359 pcc->check_pow = check_pow_hid0_74xx;
4360 pcc->check_attn = check_attn_none;
4361 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
4372 pcc->msr_mask = (1ull << MSR_VR) |
4389 pcc->mmu_model = POWERPC_MMU_32B;
4390 pcc->excp_model = POWERPC_EXCP_74xx;
4391 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
4392 pcc->bfd_mach = bfd_mach_ppc_7400;
4393 pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
4469 env->dcache_line_size = 32; in init_proc_7450()
4470 env->icache_line_size = 32; in init_proc_7450()
4480 dc->desc = "PowerPC 7450 (aka G4)";
4481 pcc->init_proc = init_proc_7450;
4482 pcc->check_pow = check_pow_hid0_74xx;
4483 pcc->check_attn = check_attn_none;
4484 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
4495 pcc->msr_mask = (1ull << MSR_VR) |
4512 pcc->mmu_model = POWERPC_MMU_32B;
4513 pcc->excp_model = POWERPC_EXCP_74xx;
4514 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
4515 pcc->bfd_mach = bfd_mach_ppc_7400;
4516 pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
4599 env->dcache_line_size = 32; in init_proc_7445()
4600 env->icache_line_size = 32; in init_proc_7445()
4610 dc->desc = "PowerPC 7445 (aka G4)";
4611 pcc->init_proc = init_proc_7445;
4612 pcc->check_pow = check_pow_hid0_74xx;
4613 pcc->check_attn = check_attn_none;
4614 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
4625 pcc->msr_mask = (1ull << MSR_VR) |
4642 pcc->mmu_model = POWERPC_MMU_32B;
4643 pcc->excp_model = POWERPC_EXCP_74xx;
4644 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
4645 pcc->bfd_mach = bfd_mach_ppc_7400;
4646 pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
4731 env->dcache_line_size = 32; in init_proc_7455()
4732 env->icache_line_size = 32; in init_proc_7455()
4742 dc->desc = "PowerPC 7455 (aka G4)";
4743 pcc->init_proc = init_proc_7455;
4744 pcc->check_pow = check_pow_hid0_74xx;
4745 pcc->check_attn = check_attn_none;
4746 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
4757 pcc->msr_mask = (1ull << MSR_VR) |
4774 pcc->mmu_model = POWERPC_MMU_32B;
4775 pcc->excp_model = POWERPC_EXCP_74xx;
4776 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
4777 pcc->bfd_mach = bfd_mach_ppc_7400;
4778 pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
4883 env->dcache_line_size = 32; in init_proc_7457()
4884 env->icache_line_size = 32; in init_proc_7457()
4894 dc->desc = "PowerPC 7457 (aka G4)";
4895 pcc->init_proc = init_proc_7457;
4896 pcc->check_pow = check_pow_hid0_74xx;
4897 pcc->check_attn = check_attn_none;
4898 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
4909 pcc->msr_mask = (1ull << MSR_VR) |
4926 pcc->mmu_model = POWERPC_MMU_32B;
4927 pcc->excp_model = POWERPC_EXCP_74xx;
4928 pcc->bus_model = PPC_FLAGS_INPUT_6xx;
4929 pcc->bfd_mach = bfd_mach_ppc_7400;
4930 pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
5018 env->dcache_line_size = 32; in init_proc_e600()
5019 env->icache_line_size = 32; in init_proc_e600()
5029 dc->desc = "PowerPC e600"; in POWERPC_FAMILY()
5030 pcc->init_proc = init_proc_e600; in POWERPC_FAMILY()
5031 pcc->check_pow = check_pow_hid0_74xx; in POWERPC_FAMILY()
5032 pcc->check_attn = check_attn_none; in POWERPC_FAMILY()
5033 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB | in POWERPC_FAMILY()
5044 pcc->insns_flags2 = PPC_NONE; in POWERPC_FAMILY()
5045 pcc->msr_mask = (1ull << MSR_VR) | in POWERPC_FAMILY()
5062 pcc->mmu_model = POWERPC_MMU_32B; in POWERPC_FAMILY()
5063 pcc->excp_model = POWERPC_EXCP_74xx; in POWERPC_FAMILY()
5064 pcc->bus_model = PPC_FLAGS_INPUT_6xx; in POWERPC_FAMILY()
5065 pcc->bfd_mach = bfd_mach_ppc_7400; in POWERPC_FAMILY()
5066 pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE | in POWERPC_FAMILY()
5080 if (env->spr[SPR_HID0] & (HID0_DEEPNAP | HID0_DOZE | HID0_NAP)) { in check_pow_970()
5126 if (!(env->insns_flags & PPC_ALTIVEC)) { in register_book3s_altivec_sprs()
5409 * support the 970 in "Apple mode" which has all hypervisor in register_970_lpar_sprs()
5524 /* PURR & SPURR: Hack - treat these as aliases for the TB for now */ in register_book3s_purr_sprs()
5695 /* Directed Privileged Door-bell Exception State, used for IPI */ in register_power8_dpdes_sprs()
5870 /* in linux-user, setup the hash register with a random value */ in register_power10_hash_sprs()
5961 env->dcache_line_size = 128; in init_proc_970()
5962 env->icache_line_size = 128; in init_proc_970()
5974 dc->desc = "PowerPC 970";
5975 pcc->init_proc = init_proc_970;
5976 pcc->check_pow = check_pow_970;
5977 pcc->check_attn = check_attn_hid0;
5978 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB |
5987 pcc->insns_flags2 = PPC2_FP_CVT_S64 | PPC2_MEM_LWSYNC;
5988 pcc->msr_mask = (1ull << MSR_SF) |
6003 pcc->mmu_model = POWERPC_MMU_64B;
6005 pcc->hash64_opts = &ppc_hash64_opts_basic;
6007 pcc->excp_model = POWERPC_EXCP_970;
6008 pcc->bus_model = PPC_FLAGS_INPUT_970;
6009 pcc->bfd_mach = bfd_mach_ppc64;
6010 pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE |
6013 pcc->l1_dcache_size = 0x8000;
6014 pcc->l1_icache_size = 0x10000;
6036 env->dcache_line_size = 128; in init_proc_power5plus()
6037 env->icache_line_size = 128; in init_proc_power5plus()
6049 dc->fw_name = "PowerPC,POWER5"; in POWERPC_FAMILY()
6050 dc->desc = "POWER5+"; in POWERPC_FAMILY()
6051 pcc->init_proc = init_proc_power5plus; in POWERPC_FAMILY()
6052 pcc->check_pow = check_pow_970; in POWERPC_FAMILY()
6053 pcc->check_attn = check_attn_hid0; in POWERPC_FAMILY()
6054 pcc->insns_flags = PPC_INSNS_BASE | PPC_STRING | PPC_MFTB | in POWERPC_FAMILY()
6065 pcc->insns_flags2 = PPC2_FP_CVT_S64 | PPC2_MEM_LWSYNC; in POWERPC_FAMILY()
6066 pcc->msr_mask = (1ull << MSR_SF) | in POWERPC_FAMILY()
6081 pcc->lpcr_mask = LPCR_RMLS | LPCR_ILE | LPCR_LPES0 | LPCR_LPES1 | in POWERPC_FAMILY()
6083 pcc->mmu_model = POWERPC_MMU_2_03; in POWERPC_FAMILY()
6085 pcc->hash64_opts = &ppc_hash64_opts_basic; in POWERPC_FAMILY()
6086 pcc->lrg_decr_bits = 32; in POWERPC_FAMILY()
6088 pcc->excp_model = POWERPC_EXCP_970; in POWERPC_FAMILY()
6089 pcc->bus_model = PPC_FLAGS_INPUT_970; in POWERPC_FAMILY()
6090 pcc->bfd_mach = bfd_mach_ppc64; in POWERPC_FAMILY()
6091 pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE | in POWERPC_FAMILY()
6094 pcc->l1_dcache_size = 0x8000; in POWERPC_FAMILY()
6095 pcc->l1_icache_size = 0x10000; in POWERPC_FAMILY()
6121 env->dcache_line_size = 128; in init_proc_POWER7()
6122 env->icache_line_size = 128; in init_proc_POWER7()
6132 uint32_t pcc_base = pcc->pvr & CPU_POWERPC_POWER_SERVER_MASK; in ppc_pvr_match_power7()
6155 dc->fw_name = "PowerPC,POWER7"; in POWERPC_FAMILY()
6156 dc->desc = "POWER7"; in POWERPC_FAMILY()
6157 pcc->spapr_logical_pvr = CPU_POWERPC_LOGICAL_2_06_PLUS; in POWERPC_FAMILY()
6158 pcc->pvr_match = ppc_pvr_match_power7; in POWERPC_FAMILY()
6159 pcc->pcr_mask = PCR_VEC_DIS | PCR_VSX_DIS | PCR_COMPAT_2_05; in POWERPC_FAMILY()
6160 pcc->pcr_supported = PCR_COMPAT_2_06 | PCR_COMPAT_2_05; in POWERPC_FAMILY()
6161 pcc->init_proc = init_proc_POWER7; in POWERPC_FAMILY()
6162 pcc->check_pow = check_pow_nocheck; in POWERPC_FAMILY()
6163 pcc->check_attn = check_attn_hid0; in POWERPC_FAMILY()
6164 pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | in POWERPC_FAMILY()
6177 pcc->insns_flags2 = PPC2_VSX | PPC2_DFP | PPC2_DBRX | PPC2_ISA205 | in POWERPC_FAMILY()
6182 pcc->msr_mask = (1ull << MSR_SF) | in POWERPC_FAMILY()
6198 pcc->lpcr_mask = LPCR_VPM0 | LPCR_VPM1 | LPCR_ISL | LPCR_DPFD | in POWERPC_FAMILY()
6203 pcc->lpcr_pm = LPCR_P7_PECE0 | LPCR_P7_PECE1 | LPCR_P7_PECE2; in POWERPC_FAMILY()
6204 pcc->mmu_model = POWERPC_MMU_2_06; in POWERPC_FAMILY()
6206 pcc->hash64_opts = &ppc_hash64_opts_POWER7; in POWERPC_FAMILY()
6207 pcc->lrg_decr_bits = 32; in POWERPC_FAMILY()
6209 pcc->excp_model = POWERPC_EXCP_POWER7; in POWERPC_FAMILY()
6210 pcc->bus_model = PPC_FLAGS_INPUT_POWER7; in POWERPC_FAMILY()
6211 pcc->bfd_mach = bfd_mach_ppc64; in POWERPC_FAMILY()
6212 pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE | in POWERPC_FAMILY()
6216 pcc->l1_dcache_size = 0x8000; in POWERPC_FAMILY()
6217 pcc->l1_icache_size = 0x8000; in POWERPC_FAMILY()
6222 if (env->flags & POWERPC_FLAG_BHRB) { in bhrb_init_state()
6226 env->bhrb_num_entries = 1 << num_entries_log2; in bhrb_init_state()
6227 env->bhrb_base = (intptr_t)&env->bhrb[0]; in bhrb_init_state()
6228 env->bhrb_offset_mask = (env->bhrb_num_entries * sizeof(uint64_t)) - 1; in bhrb_init_state()
6234 if (env->flags & POWERPC_FLAG_BHRB) { in bhrb_reset_state()
6235 env->bhrb_offset = 0; in bhrb_reset_state()
6236 env->bhrb_filter = 0; in bhrb_reset_state()
6237 memset(env->bhrb, 0, sizeof(env->bhrb)); in bhrb_reset_state()
6281 env->dcache_line_size = 128; in init_proc_POWER8()
6282 env->icache_line_size = 128; in init_proc_POWER8()
6294 uint32_t pcc_base = pcc->pvr & CPU_POWERPC_POWER_SERVER_MASK; in ppc_pvr_match_power8()
6319 dc->fw_name = "PowerPC,POWER8"; in POWERPC_FAMILY()
6320 dc->desc = "POWER8"; in POWERPC_FAMILY()
6321 pcc->spapr_logical_pvr = CPU_POWERPC_LOGICAL_2_07; in POWERPC_FAMILY()
6322 pcc->pvr_match = ppc_pvr_match_power8; in POWERPC_FAMILY()
6323 pcc->pcr_mask = PCR_TM_DIS | PCR_COMPAT_2_06 | PCR_COMPAT_2_05; in POWERPC_FAMILY()
6324 pcc->pcr_supported = PCR_COMPAT_2_07 | PCR_COMPAT_2_06 | PCR_COMPAT_2_05; in POWERPC_FAMILY()
6325 pcc->init_proc = init_proc_POWER8; in POWERPC_FAMILY()
6326 pcc->check_pow = check_pow_nocheck; in POWERPC_FAMILY()
6327 pcc->check_attn = check_attn_hid0; in POWERPC_FAMILY()
6328 pcc->insns_flags = PPC_INSNS_BASE | PPC_ISEL | PPC_STRING | PPC_MFTB | in POWERPC_FAMILY()
6341 pcc->insns_flags2 = PPC2_VSX | PPC2_VSX207 | PPC2_DFP | PPC2_DBRX | in POWERPC_FAMILY()
6349 pcc->msr_mask = (1ull << MSR_SF) | in POWERPC_FAMILY()
6369 pcc->lpcr_mask = LPCR_VPM0 | LPCR_VPM1 | LPCR_ISL | LPCR_KBV | in POWERPC_FAMILY()
6374 pcc->lpcr_pm = LPCR_P8_PECE0 | LPCR_P8_PECE1 | LPCR_P8_PECE2 | in POWERPC_FAMILY()
6376 pcc->mmu_model = POWERPC_MMU_2_07; in POWERPC_FAMILY()
6378 pcc->hash64_opts = &ppc_hash64_opts_POWER7; in POWERPC_FAMILY()
6379 pcc->lrg_decr_bits = 32; in POWERPC_FAMILY()
6380 pcc->n_host_threads = 8; in POWERPC_FAMILY()
6382 pcc->excp_model = POWERPC_EXCP_POWER8; in POWERPC_FAMILY()
6383 pcc->bus_model = PPC_FLAGS_INPUT_POWER7; in POWERPC_FAMILY()
6384 pcc->bfd_mach = bfd_mach_ppc64; in POWERPC_FAMILY()
6385 pcc->flags = POWERPC_FLAG_VRE | POWERPC_FLAG_SE | in POWERPC_FAMILY()
6389 pcc->l1_dcache_size = 0x8000; in POWERPC_FAMILY()
6390 pcc->l1_icache_size = 0x8000; in POWERPC_FAMILY()
6395 * Radix pg sizes and AP encodings for dt node ibm,processor-radix-AP-encodings
6398 * x -> AP encoding
6399 * y -> radix mode supported page size (encoded as a shift)
6404 0x0000000c, /* 4K - enc: 0x0 */
6405 0xa0000010, /* 64K - enc: 0x5 */
6406 0x20000015, /* 2M - enc: 0x1 */
6407 0x4000001e /* 1G - enc: 0x2 */
6465 env->dcache_line_size = 128; in init_proc_POWER9()
6466 env->icache_line_size = 128; in init_proc_POWER9()
6478 uint32_t pcc_base = pcc->pvr & CPU_POWERPC_POWER_SERVER_MASK; in ppc_pvr_match_power9()
6490 if ((pvr & 0x0f00) != (pcc->pvr & 0x0f00)) { in ppc_pvr_match_power9()
6498 if ((pcc->pvr & 0xf) == 0) { in ppc_pvr_match_power9()
6503 if ((pcc->pvr & 0xf) == 2) { in ppc_pvr_match_power9()
6517 dc->fw_name = "PowerPC,POWER9"; in POWERPC_FAMILY()
6518 dc->desc = "POWER9"; in POWERPC_FAMILY()
6519 pcc->spapr_logical_pvr = CPU_POWERPC_LOGICAL_3_00; in POWERPC_FAMILY()
6520 pcc->pvr_match = ppc_pvr_match_power9; in POWERPC_FAMILY()
6521 pcc->pcr_mask = PPC_PCR_MASK_POWER9; in POWERPC_FAMILY()
6522 pcc->pcr_supported = PPC_PCR_SUPPORTED_POWER9; in POWERPC_FAMILY()
6523 pcc->init_proc = init_proc_POWER9; in POWERPC_FAMILY()
6524 pcc->check_pow = check_pow_nocheck; in POWERPC_FAMILY()
6525 pcc->check_attn = check_attn_hid0_power9; in POWERPC_FAMILY()
6526 pcc->insns_flags = PPC_INSNS_FLAGS_POWER9; in POWERPC_FAMILY()
6527 pcc->insns_flags2 = PPC_INSNS_FLAGS2_POWER9; in POWERPC_FAMILY()
6528 pcc->msr_mask = PPC_MSR_MASK_POWER9; in POWERPC_FAMILY()
6529 pcc->lpcr_mask = PPC_LPCR_MASK_POWER9; in POWERPC_FAMILY()
6530 pcc->lpcr_pm = LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE | LPCR_OEE; in POWERPC_FAMILY()
6531 pcc->mmu_model = POWERPC_MMU_3_00; in POWERPC_FAMILY()
6534 pcc->hash64_opts = &ppc_hash64_opts_POWER7; in POWERPC_FAMILY()
6535 pcc->radix_page_info = &POWER9_radix_page_info; in POWERPC_FAMILY()
6536 pcc->lrg_decr_bits = 56; in POWERPC_FAMILY()
6537 pcc->n_host_threads = 4; in POWERPC_FAMILY()
6539 pcc->excp_model = POWERPC_EXCP_POWER9; in POWERPC_FAMILY()
6540 pcc->bus_model = PPC_FLAGS_INPUT_POWER9; in POWERPC_FAMILY()
6541 pcc->bfd_mach = bfd_mach_ppc64; in POWERPC_FAMILY()
6542 pcc->flags = POWERPC_FLAGS_POWER9; in POWERPC_FAMILY()
6543 pcc->l1_dcache_size = 0x8000; in POWERPC_FAMILY()
6544 pcc->l1_icache_size = 0x8000; in POWERPC_FAMILY()
6549 * Radix pg sizes and AP encodings for dt node ibm,processor-radix-AP-encodings
6552 * x -> AP encoding
6553 * y -> radix mode supported page size (encoded as a shift)
6558 0x0000000c, /* 4K - enc: 0x0 */
6559 0xa0000010, /* 64K - enc: 0x5 */
6560 0x20000015, /* 2M - enc: 0x1 */
6561 0x4000001e /* 1G - enc: 0x2 */
6576 env->dcache_line_size = 128; in init_proc_POWER10()
6577 env->icache_line_size = 128; in init_proc_POWER10()
6589 uint32_t pcc_base = pcc->pvr & CPU_POWERPC_POWER_SERVER_MASK; in ppc_pvr_match_power10()
6601 if ((pvr & 0x0f00) == (pcc->pvr & 0x0f00)) { in ppc_pvr_match_power10()
6614 dc->fw_name = "PowerPC,POWER10"; in POWERPC_FAMILY()
6615 dc->desc = "POWER10"; in POWERPC_FAMILY()
6616 pcc->spapr_logical_pvr = CPU_POWERPC_LOGICAL_3_10; in POWERPC_FAMILY()
6617 pcc->pvr_match = ppc_pvr_match_power10; in POWERPC_FAMILY()
6618 pcc->pcr_mask = PPC_PCR_MASK_POWER10; in POWERPC_FAMILY()
6619 pcc->pcr_supported = PPC_PCR_SUPPORTED_POWER10; in POWERPC_FAMILY()
6620 pcc->init_proc = init_proc_POWER10; in POWERPC_FAMILY()
6621 pcc->check_pow = check_pow_nocheck; in POWERPC_FAMILY()
6622 pcc->check_attn = check_attn_hid0_power9; in POWERPC_FAMILY()
6623 pcc->insns_flags = PPC_INSNS_FLAGS_POWER10; in POWERPC_FAMILY()
6624 pcc->insns_flags2 = PPC_INSNS_FLAGS2_POWER10; in POWERPC_FAMILY()
6625 pcc->msr_mask = PPC_MSR_MASK_POWER10; in POWERPC_FAMILY()
6626 pcc->lpcr_mask = PPC_LPCR_MASK_POWER10; in POWERPC_FAMILY()
6628 pcc->lpcr_pm = LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE | LPCR_OEE; in POWERPC_FAMILY()
6629 pcc->mmu_model = POWERPC_MMU_3_00; in POWERPC_FAMILY()
6632 pcc->hash64_opts = &ppc_hash64_opts_POWER7; in POWERPC_FAMILY()
6633 pcc->radix_page_info = &POWER10_radix_page_info; in POWERPC_FAMILY()
6634 pcc->lrg_decr_bits = 56; in POWERPC_FAMILY()
6636 pcc->excp_model = POWERPC_EXCP_POWER10; in POWERPC_FAMILY()
6637 pcc->bus_model = PPC_FLAGS_INPUT_POWER9; in POWERPC_FAMILY()
6638 pcc->bfd_mach = bfd_mach_ppc64; in POWERPC_FAMILY()
6639 pcc->flags = POWERPC_FLAGS_POWER10; in POWERPC_FAMILY()
6640 pcc->l1_dcache_size = 0x8000; in POWERPC_FAMILY()
6641 pcc->l1_icache_size = 0x8000; in POWERPC_FAMILY()
6652 uint32_t pcc_base = pcc->pvr & CPU_POWERPC_POWER_SERVER_MASK; in ppc_pvr_match_power11()
6662 if ((pvr & 0x0f00) == (pcc->pvr & 0x0f00)) { in ppc_pvr_match_power11()
6674 dc->fw_name = "PowerPC,POWER11"; in POWERPC_FAMILY()
6675 dc->desc = "POWER11"; in POWERPC_FAMILY()
6676 pcc->spapr_logical_pvr = CPU_POWERPC_LOGICAL_3_10_P11; in POWERPC_FAMILY()
6677 pcc->pvr_match = ppc_pvr_match_power11; in POWERPC_FAMILY()
6678 pcc->pcr_mask = PPC_PCR_MASK_POWER11; in POWERPC_FAMILY()
6679 pcc->pcr_supported = PPC_PCR_SUPPORTED_POWER11; in POWERPC_FAMILY()
6680 pcc->init_proc = init_proc_POWER11; in POWERPC_FAMILY()
6681 pcc->check_pow = check_pow_nocheck; in POWERPC_FAMILY()
6682 pcc->check_attn = check_attn_hid0_power9; in POWERPC_FAMILY()
6683 pcc->insns_flags = PPC_INSNS_FLAGS_POWER11; in POWERPC_FAMILY()
6684 pcc->insns_flags2 = PPC_INSNS_FLAGS2_POWER11; in POWERPC_FAMILY()
6685 pcc->msr_mask = PPC_MSR_MASK_POWER11; in POWERPC_FAMILY()
6686 pcc->lpcr_mask = PPC_LPCR_MASK_POWER11; in POWERPC_FAMILY()
6688 pcc->lpcr_pm = LPCR_PDEE | LPCR_HDEE | LPCR_EEE | LPCR_DEE | LPCR_OEE; in POWERPC_FAMILY()
6689 pcc->mmu_model = POWERPC_MMU_3_00; in POWERPC_FAMILY()
6692 pcc->hash64_opts = &ppc_hash64_opts_POWER7; in POWERPC_FAMILY()
6693 pcc->radix_page_info = &POWER10_radix_page_info; in POWERPC_FAMILY()
6694 pcc->lrg_decr_bits = 56; in POWERPC_FAMILY()
6696 pcc->excp_model = POWERPC_EXCP_POWER11; in POWERPC_FAMILY()
6697 pcc->bus_model = PPC_FLAGS_INPUT_POWER9; in POWERPC_FAMILY()
6698 pcc->bfd_mach = bfd_mach_ppc64; in POWERPC_FAMILY()
6699 pcc->flags = POWERPC_FLAGS_POWER11; in POWERPC_FAMILY()
6700 pcc->l1_dcache_size = 0x8000; in POWERPC_FAMILY()
6701 pcc->l1_icache_size = 0x8000; in POWERPC_FAMILY()
6707 CPUPPCState *env = &cpu->env; in cpu_ppc_set_vhyp()
6709 cpu->vhyp = vhyp; in cpu_ppc_set_vhyp()
6710 cpu->vhyp_class = PPC_VIRTUAL_HYPERVISOR_GET_CLASS(vhyp); in cpu_ppc_set_vhyp()
6713 * With a virtual hypervisor mode we never allow the CPU to go in cpu_ppc_set_vhyp()
6714 * hypervisor mode itself in cpu_ppc_set_vhyp()
6716 env->msr_mask &= ~MSR_HVB; in cpu_ppc_set_vhyp()
6721 CPUPPCState *env = &cpu->env; in cpu_ppc_set_1lpar()
6724 * pseries SMT means "LPAR per core" mode, e.g., msgsndp is usable in cpu_ppc_set_1lpar()
6725 * between threads. powernv be in either mode, and it mostly affects in cpu_ppc_set_1lpar()
6726 * supervisor visible registers and instructions. in cpu_ppc_set_1lpar()
6728 if (env->flags & POWERPC_FLAG_SMT) { in cpu_ppc_set_1lpar()
6729 env->flags |= POWERPC_FLAG_SMT_1LPAR; in cpu_ppc_set_1lpar()
6741 CPUPPCState *env = &cpu->env; in init_ppc_proc()
6747 env->excp_vectors[i] = (target_ulong)(-1ULL); in init_ppc_proc()
6749 env->ivor_mask = 0x00000000; in init_ppc_proc()
6750 env->ivpr_mask = 0x00000000; in init_ppc_proc()
6752 env->nb_BATs = 0; in init_ppc_proc()
6753 env->nb_tlb = 0; in init_ppc_proc()
6754 env->nb_ways = 0; in init_ppc_proc()
6755 env->tlb_type = TLB_NONE; in init_ppc_proc()
6761 (*pcc->init_proc)(env); in init_ppc_proc()
6764 if (env->msr_mask & (1 << 25)) { in init_ppc_proc()
6765 switch (env->flags & (POWERPC_FLAG_SPE | POWERPC_FLAG_VRE)) { in init_ppc_proc()
6774 } else if (env->flags & (POWERPC_FLAG_SPE | POWERPC_FLAG_VRE)) { in init_ppc_proc()
6779 if (env->msr_mask & (1 << 17)) { in init_ppc_proc()
6780 switch (env->flags & (POWERPC_FLAG_TGPR | POWERPC_FLAG_CE)) { in init_ppc_proc()
6789 } else if (env->flags & (POWERPC_FLAG_TGPR | POWERPC_FLAG_CE)) { in init_ppc_proc()
6794 if (env->msr_mask & (1 << 10)) { in init_ppc_proc()
6795 switch (env->flags & (POWERPC_FLAG_SE | POWERPC_FLAG_DWE | in init_ppc_proc()
6807 } else if (env->flags & (POWERPC_FLAG_SE | POWERPC_FLAG_DWE | in init_ppc_proc()
6814 if (env->msr_mask & (1 << 9)) { in init_ppc_proc()
6815 switch (env->flags & (POWERPC_FLAG_BE | POWERPC_FLAG_DE)) { in init_ppc_proc()
6824 } else if (env->flags & (POWERPC_FLAG_BE | POWERPC_FLAG_DE)) { in init_ppc_proc()
6829 if (env->msr_mask & (1 << 2)) { in init_ppc_proc()
6830 switch (env->flags & (POWERPC_FLAG_PX | POWERPC_FLAG_PMM)) { in init_ppc_proc()
6839 } else if (env->flags & (POWERPC_FLAG_PX | POWERPC_FLAG_PMM)) { in init_ppc_proc()
6844 if ((env->flags & POWERPC_FLAG_BUS_CLK) == 0) { in init_ppc_proc()
6846 "Should define the time-base and decrementer clock source\n"); in init_ppc_proc()
6851 if (env->nb_tlb) { in init_ppc_proc()
6852 switch (env->tlb_type) { in init_ppc_proc()
6855 env->tlb.tlb6 = g_new0(ppc6xx_tlb_t, 2 * env->nb_tlb); in init_ppc_proc()
6858 env->tlb.tlbe = g_new0(ppcemb_tlb_t, env->nb_tlb); in init_ppc_proc()
6861 env->tlb.tlbm = g_new0(ppcmas_tlb_t, env->nb_tlb); in init_ppc_proc()
6864 /* Pre-compute some useful values */ in init_ppc_proc()
6865 env->tlb_per_way = env->nb_tlb / env->nb_ways; in init_ppc_proc()
6868 if (env->check_pow == NULL) { in init_ppc_proc()
6873 if (env->check_attn == NULL) { in init_ppc_proc()
6884 CPUPPCState *env = &cpu->env; in ppc_cpu_realize()
6893 if (cpu->vcpu_id == UNASSIGNED_CPU_INDEX) { in ppc_cpu_realize()
6894 cpu->vcpu_id = cs->cpu_index; in ppc_cpu_realize()
6914 pcc->parent_realize(dev, errp); in ppc_cpu_realize()
6917 env->flags |= POWERPC_FLAG_SMT; in ppc_cpu_realize()
6931 pcc->parent_unrealize(dev); in ppc_cpu_unrealize()
6944 /* -cpu host does a PVR lookup during construction */ in ppc_cpu_compare_class_pvr()
6947 return -1; in ppc_cpu_compare_class_pvr()
6950 return pcc->pvr == pvr ? 0 : -1; in ppc_cpu_compare_class_pvr()
6961 pcc = POWERPC_CPU_CLASS(item->data); in ppc_cpu_class_by_pvr()
6974 /* -cpu host does a PVR lookup during construction */ in ppc_cpu_compare_class_pvr_mask()
6977 return -1; in ppc_cpu_compare_class_pvr_mask()
6980 if (pcc->pvr_match(pcc, pvr, true)) { in ppc_cpu_compare_class_pvr_mask()
6984 return -1; in ppc_cpu_compare_class_pvr_mask()
6995 pcc = POWERPC_CPU_CLASS(item->data); in ppc_cpu_class_by_pvr_mask()
7027 int len = p - name; in ppc_cpu_class_by_name()
7028 len = (len == 10) && (name[1] == 'x') ? len - 2 : len; in ppc_cpu_class_by_name()
7044 return object_class_by_name(mc->default_cpu_type); in ppc_cpu_class_by_name()
7049 cpu_model = g_ascii_strdown(name, -1); in ppc_cpu_class_by_name()
7089 return -1; in ppc_cpu_list_compare()
7092 if (pcc_a->pvr < pcc_b->pvr) { in ppc_cpu_list_compare()
7093 return -1; in ppc_cpu_list_compare()
7094 } else if (pcc_a->pvr > pcc_b->pvr) { in ppc_cpu_list_compare()
7116 qemu_printf(" %-16s PVR %08x\n", name, pcc->pvr); in ppc_cpu_list_entry()
7119 ObjectClass *alias_oc = ppc_cpu_class_by_name(alias->model); in ppc_cpu_list_entry()
7128 if (strcmp(alias->alias, family->desc) == 0) { in ppc_cpu_list_entry()
7129 qemu_printf(" %-16s (alias for preferred %s CPU)\n", in ppc_cpu_list_entry()
7130 alias->alias, family->desc); in ppc_cpu_list_entry()
7132 qemu_printf(" %-16s (alias for %s)\n", in ppc_cpu_list_entry()
7133 alias->alias, name); in ppc_cpu_list_entry()
7159 cpu->env.nip = value; in ppc_cpu_set_pc()
7166 return cpu->env.nip; in ppc_cpu_get_pc()
7176 cpu->env.nip = data[0]; in ppc_restore_state_to_opc()
7182 return cs->interrupt_request & CPU_INTERRUPT_HARD; in ppc_cpu_has_work()
7195 CPUPPCState *env = &cpu->env; in ppc_cpu_reset_hold()
7199 if (pcc->parent_phases.hold) { in ppc_cpu_reset_hold()
7200 pcc->parent_phases.hold(obj, type); in ppc_cpu_reset_hold()
7207 /* Single step trace mode */ in ppc_cpu_reset_hold()
7223 msr |= (target_ulong)1 << MSR_LE; /* Little-endian user mode */ in ppc_cpu_reset_hold()
7224 if (!((env->msr_mask >> MSR_LE) & 1)) { in ppc_cpu_reset_hold()
7225 fprintf(stderr, "Selected CPU does not support little-endian.\n"); in ppc_cpu_reset_hold()
7232 if (mmu_is_64bit(env->mmu_model)) { in ppc_cpu_reset_hold()
7240 env->nip = env->hreset_vector | env->excp_prefix; in ppc_cpu_reset_hold()
7245 if (env->mmu_model != POWERPC_MMU_REAL) { in ppc_cpu_reset_hold()
7252 env->resume_as_sreset = 0; in ppc_cpu_reset_hold()
7255 env->reserve_addr = (target_ulong)-1ULL; in ppc_cpu_reset_hold()
7257 env->pending_interrupts = 0; in ppc_cpu_reset_hold()
7258 cs->exception_index = POWERPC_EXCP_NONE; in ppc_cpu_reset_hold()
7259 env->error_code = 0; in ppc_cpu_reset_hold()
7264 &env->fp_status); in ppc_cpu_reset_hold()
7271 set_float_2nan_prop_rule(float_2nan_prop_ab, &env->fp_status); in ppc_cpu_reset_hold()
7272 set_float_2nan_prop_rule(float_2nan_prop_ab, &env->vec_status); in ppc_cpu_reset_hold()
7274 for (i = 0; i < ARRAY_SIZE(env->spr_cb); i++) { in ppc_cpu_reset_hold()
7275 ppc_spr_t *spr = &env->spr_cb[i]; in ppc_cpu_reset_hold()
7277 if (!spr->name) { in ppc_cpu_reset_hold()
7280 env->spr[i] = spr->default_value; in ppc_cpu_reset_hold()
7294 return !FIELD_EX64(cpu_env(cs)->msr, MSR, LE); in ppc_cpu_is_big_endian()
7300 CPUPPCState *env = &POWERPC_CPU(obj)->env; in ppc_get_irq_stats()
7302 *irq_counts = env->excp_stats; in ppc_get_irq_stats()
7303 *nb_irqs = ARRAY_SIZE(env->excp_stats); in ppc_get_irq_stats()
7312 if (cpu->vhyp) { in ppc_cpu_exec_enter()
7313 cpu->vhyp_class->cpu_exec_enter(cpu->vhyp, cpu); in ppc_cpu_exec_enter()
7321 if (cpu->vhyp) { in ppc_cpu_exec_exit()
7322 cpu->vhyp_class->cpu_exec_exit(cpu->vhyp, cpu); in ppc_cpu_exec_exit()
7333 CPUPPCState *env = &cpu->env; in ppc_cpu_instance_init()
7335 cpu->vcpu_id = UNASSIGNED_CPU_INDEX; in ppc_cpu_instance_init()
7337 env->msr_mask = pcc->msr_mask; in ppc_cpu_instance_init()
7338 env->mmu_model = pcc->mmu_model; in ppc_cpu_instance_init()
7339 env->excp_model = pcc->excp_model; in ppc_cpu_instance_init()
7340 env->bus_model = pcc->bus_model; in ppc_cpu_instance_init()
7341 env->insns_flags = pcc->insns_flags; in ppc_cpu_instance_init()
7342 env->insns_flags2 = pcc->insns_flags2; in ppc_cpu_instance_init()
7343 env->flags = pcc->flags; in ppc_cpu_instance_init()
7344 env->bfd_mach = pcc->bfd_mach; in ppc_cpu_instance_init()
7345 env->check_pow = pcc->check_pow; in ppc_cpu_instance_init()
7346 env->check_attn = pcc->check_attn; in ppc_cpu_instance_init()
7349 * Mark HV mode as supported if the CPU has an MSR_HV bit in the in ppc_cpu_instance_init()
7350 * msr_mask. The mask can later be cleared by PAPR mode but the hv in ppc_cpu_instance_init()
7351 * mode support will remain, thus enforcing that we cannot use in ppc_cpu_instance_init()
7352 * priv. instructions in guest in PAPR mode. For 970 we currently in ppc_cpu_instance_init()
7353 * simply don't set HV in msr_mask thus simulating an "Apple mode" in ppc_cpu_instance_init()
7354 * 970. If we ever want to support 970 HV mode, we'll have to add in ppc_cpu_instance_init()
7358 env->has_hv_mode = !!(env->msr_mask & MSR_HVB); in ppc_cpu_instance_init()
7373 return pcc->pvr == pvr; in ppc_pvr_match_default()
7380 if ((env->hflags >> MSR_LE) & 1) { in ppc_disas_set_info()
7381 info->endian = BFD_ENDIAN_LITTLE; in ppc_disas_set_info()
7383 info->mach = env->bfd_mach; in ppc_disas_set_info()
7384 if (!env->bfd_mach) { in ppc_disas_set_info()
7386 info->mach = bfd_mach_ppc64; in ppc_disas_set_info()
7388 info->mach = bfd_mach_ppc; in ppc_disas_set_info()
7392 info->cap_arch = CS_ARCH_PPC; in ppc_disas_set_info()
7394 info->cap_mode = CS_MODE_64; in ppc_disas_set_info()
7404 #include "hw/core/sysemu-cpu-ops.h"
7416 #include "hw/core/tcg-cpu-ops.h"
7448 &pcc->parent_realize); in ppc_cpu_class_init()
7450 &pcc->parent_unrealize); in ppc_cpu_class_init()
7451 pcc->pvr_match = ppc_pvr_match_default; in ppc_cpu_class_init()
7455 &pcc->parent_phases); in ppc_cpu_class_init()
7457 cc->class_by_name = ppc_cpu_class_by_name; in ppc_cpu_class_init()
7458 cc->has_work = ppc_cpu_has_work; in ppc_cpu_class_init()
7459 cc->mmu_index = ppc_cpu_mmu_index; in ppc_cpu_class_init()
7460 cc->dump_state = ppc_cpu_dump_state; in ppc_cpu_class_init()
7461 cc->set_pc = ppc_cpu_set_pc; in ppc_cpu_class_init()
7462 cc->get_pc = ppc_cpu_get_pc; in ppc_cpu_class_init()
7463 cc->gdb_read_register = ppc_cpu_gdb_read_register; in ppc_cpu_class_init()
7464 cc->gdb_write_register = ppc_cpu_gdb_write_register; in ppc_cpu_class_init()
7466 cc->sysemu_ops = &ppc_sysemu_ops; in ppc_cpu_class_init()
7467 INTERRUPT_STATS_PROVIDER_CLASS(oc)->get_statistics = ppc_get_irq_stats; in ppc_cpu_class_init()
7475 cc->gdb_num_core_regs = 71; in ppc_cpu_class_init()
7477 cc->gdb_read_register = ppc_cpu_gdb_read_register_apple; in ppc_cpu_class_init()
7478 cc->gdb_write_register = ppc_cpu_gdb_write_register_apple; in ppc_cpu_class_init()
7479 cc->gdb_num_core_regs = 71 + 32; in ppc_cpu_class_init()
7482 cc->gdb_arch_name = ppc_gdb_arch_name; in ppc_cpu_class_init()
7484 cc->gdb_core_xml_file = "power64-core.xml"; in ppc_cpu_class_init()
7486 cc->gdb_core_xml_file = "power-core.xml"; in ppc_cpu_class_init()
7488 cc->disas_set_info = ppc_disas_set_info; in ppc_cpu_class_init()
7490 dc->fw_name = "PowerPC,UNKNOWN"; in ppc_cpu_class_init()
7493 cc->tcg_ops = &ppc_tcg_ops; in ppc_cpu_class_init()
7541 env->nip, env->lr, env->ctr, cpu_read_xer(env), in ppc_cpu_dump_state()
7542 cs->cpu_index); in ppc_cpu_dump_state()
7545 env->msr, env->spr[SPR_HID0], env->hflags, in ppc_cpu_dump_state()
7548 if (env->tb_env) { in ppc_cpu_dump_state()
7558 if ((i & (RGPL - 1)) == 0) { in ppc_cpu_dump_state()
7562 if ((i & (RGPL - 1)) == (RGPL - 1)) { in ppc_cpu_dump_state()
7568 qemu_fprintf(f, "%01x", env->crf[i]); in ppc_cpu_dump_state()
7571 char a = '-'; in ppc_cpu_dump_state()
7572 if (env->crf[i] & 0x08) { in ppc_cpu_dump_state()
7574 } else if (env->crf[i] & 0x04) { in ppc_cpu_dump_state()
7576 } else if (env->crf[i] & 0x02) { in ppc_cpu_dump_state()
7579 qemu_fprintf(f, " %c%c", a, env->crf[i] & 0x01 ? 'O' : ' '); in ppc_cpu_dump_state()
7582 (int)env->reserve_length, env->reserve_addr); in ppc_cpu_dump_state()
7586 if ((i & (RFPL - 1)) == 0) { in ppc_cpu_dump_state()
7590 if ((i & (RFPL - 1)) == (RFPL - 1)) { in ppc_cpu_dump_state()
7594 qemu_fprintf(f, "FPSCR " TARGET_FMT_lx "\n", env->fpscr); in ppc_cpu_dump_state()
7600 env->spr[SPR_SRR0], env->spr[SPR_SRR1], in ppc_cpu_dump_state()
7601 env->spr[SPR_PVR], env->spr[SPR_VRSAVE]); in ppc_cpu_dump_state()
7605 env->spr[SPR_SPRG0], env->spr[SPR_SPRG1], in ppc_cpu_dump_state()
7606 env->spr[SPR_SPRG2], env->spr[SPR_SPRG3]); in ppc_cpu_dump_state()
7610 env->spr[SPR_SPRG4], env->spr[SPR_SPRG5], in ppc_cpu_dump_state()
7611 env->spr[SPR_SPRG6], env->spr[SPR_SPRG7]); in ppc_cpu_dump_state()
7613 switch (env->excp_model) { in ppc_cpu_dump_state()
7620 env->spr[SPR_HSRR0], env->spr[SPR_HSRR1]); in ppc_cpu_dump_state()
7626 env->spr[SPR_BOOKE_CSRR0], env->spr[SPR_BOOKE_CSRR1], in ppc_cpu_dump_state()
7627 env->spr[SPR_BOOKE_MCSRR0], env->spr[SPR_BOOKE_MCSRR1]); in ppc_cpu_dump_state()
7631 env->spr[SPR_BOOKE_TCR], env->spr[SPR_BOOKE_TSR], in ppc_cpu_dump_state()
7632 env->spr[SPR_BOOKE_ESR], env->spr[SPR_BOOKE_DEAR]); in ppc_cpu_dump_state()
7636 env->spr[SPR_BOOKE_PIR], env->spr[SPR_BOOKE_DECAR], in ppc_cpu_dump_state()
7637 env->spr[SPR_BOOKE_IVPR], env->spr[SPR_BOOKE_EPCR]); in ppc_cpu_dump_state()
7641 env->spr[SPR_BOOKE_MCSR], env->spr[SPR_BOOKE_SPRG8], in ppc_cpu_dump_state()
7642 env->spr[SPR_BOOKE_EPR]); in ppc_cpu_dump_state()
7644 /* FSL-specific */ in ppc_cpu_dump_state()
7647 env->spr[SPR_Exxx_MCAR], env->spr[SPR_BOOKE_PID1], in ppc_cpu_dump_state()
7648 env->spr[SPR_BOOKE_PID2], env->spr[SPR_E500_SVR]); in ppc_cpu_dump_state()
7651 * IVORs are left out as they are large and do not change often -- in ppc_cpu_dump_state()
7658 env->spr[SPR_40x_TCR], env->spr[SPR_40x_TSR], in ppc_cpu_dump_state()
7659 env->spr[SPR_40x_ESR], env->spr[SPR_40x_DEAR]); in ppc_cpu_dump_state()
7663 env->spr[SPR_40x_EVPR], env->spr[SPR_40x_SRR2], in ppc_cpu_dump_state()
7664 env->spr[SPR_40x_SRR3], env->spr[SPR_40x_PID]); in ppc_cpu_dump_state()
7671 if (env->flags & POWERPC_FLAG_CFAR) { in ppc_cpu_dump_state()
7672 qemu_fprintf(f, " CFAR " TARGET_FMT_lx"\n", env->cfar); in ppc_cpu_dump_state()
7676 if (env->spr_cb[SPR_LPCR].name) { in ppc_cpu_dump_state()
7677 qemu_fprintf(f, " LPCR " TARGET_FMT_lx "\n", env->spr[SPR_LPCR]); in ppc_cpu_dump_state()
7680 switch (env->mmu_model) { in ppc_cpu_dump_state()
7690 if (env->spr_cb[SPR_SDR1].name) { /* SDR1 Exists */ in ppc_cpu_dump_state()
7691 qemu_fprintf(f, " SDR1 " TARGET_FMT_lx " ", env->spr[SPR_SDR1]); in ppc_cpu_dump_state()
7693 if (env->spr_cb[SPR_PTCR].name) { /* PTCR Exists */ in ppc_cpu_dump_state()
7694 qemu_fprintf(f, " PTCR " TARGET_FMT_lx " ", env->spr[SPR_PTCR]); in ppc_cpu_dump_state()
7697 env->spr[SPR_DAR], env->spr[SPR_DSISR]); in ppc_cpu_dump_state()
7702 env->spr[SPR_BOOKE_MAS0], env->spr[SPR_BOOKE_MAS1], in ppc_cpu_dump_state()
7703 env->spr[SPR_BOOKE_MAS2], env->spr[SPR_BOOKE_MAS3]); in ppc_cpu_dump_state()
7707 env->spr[SPR_BOOKE_MAS4], env->spr[SPR_BOOKE_MAS6], in ppc_cpu_dump_state()
7708 env->spr[SPR_BOOKE_MAS7], env->spr[SPR_BOOKE_PID]); in ppc_cpu_dump_state()
7712 env->spr[SPR_MMUCFG], env->spr[SPR_BOOKE_TLB0CFG], in ppc_cpu_dump_state()
7713 env->spr[SPR_BOOKE_TLB1CFG]); in ppc_cpu_dump_state()