Commit fb79ceb91a6ff9ee52265893f9d66dd6833726da

Authored by blueswir1
1 parent cb3df91a

Make UA200x features selectable, add MMU types


git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4911 c046a42c-6fe2-441c-8c8c-71466251a162
target-sparc/cpu.h
@@ -238,6 +238,7 @@ typedef struct CPUSPARCState { @@ -238,6 +238,7 @@ typedef struct CPUSPARCState {
238 uint64_t itlb_tte[64]; 238 uint64_t itlb_tte[64];
239 uint64_t dtlb_tag[64]; 239 uint64_t dtlb_tag[64];
240 uint64_t dtlb_tte[64]; 240 uint64_t dtlb_tte[64];
  241 + uint32_t mmu_version;
241 #else 242 #else
242 uint32_t mmuregs[32]; 243 uint32_t mmuregs[32];
243 uint64_t mxccdata[4]; 244 uint64_t mxccdata[4];
@@ -285,6 +286,9 @@ typedef struct CPUSPARCState { @@ -285,6 +286,9 @@ typedef struct CPUSPARCState {
285 #define CPU_FEATURE_VIS1 (1 << 8) 286 #define CPU_FEATURE_VIS1 (1 << 8)
286 #define CPU_FEATURE_VIS2 (1 << 9) 287 #define CPU_FEATURE_VIS2 (1 << 9)
287 #define CPU_FEATURE_FSMULD (1 << 10) 288 #define CPU_FEATURE_FSMULD (1 << 10)
  289 +#define CPU_FEATURE_HYPV (1 << 11)
  290 +#define CPU_FEATURE_CMT (1 << 12)
  291 +#define CPU_FEATURE_GL (1 << 13)
288 #ifndef TARGET_SPARC64 292 #ifndef TARGET_SPARC64
289 #define CPU_DEFAULT_FEATURES (CPU_FEATURE_FLOAT | CPU_FEATURE_SWAP | \ 293 #define CPU_DEFAULT_FEATURES (CPU_FEATURE_FLOAT | CPU_FEATURE_SWAP | \
290 CPU_FEATURE_MUL | CPU_FEATURE_DIV | \ 294 CPU_FEATURE_MUL | CPU_FEATURE_DIV | \
@@ -296,6 +300,12 @@ typedef struct CPUSPARCState { @@ -296,6 +300,12 @@ typedef struct CPUSPARCState {
296 CPU_FEATURE_FLUSH | CPU_FEATURE_FSQRT | \ 300 CPU_FEATURE_FLUSH | CPU_FEATURE_FSQRT | \
297 CPU_FEATURE_FMUL | CPU_FEATURE_VIS1 | \ 301 CPU_FEATURE_FMUL | CPU_FEATURE_VIS1 | \
298 CPU_FEATURE_VIS2 | CPU_FEATURE_FSMULD) 302 CPU_FEATURE_VIS2 | CPU_FEATURE_FSMULD)
  303 +enum {
  304 + mmu_us_12, // Ultrasparc < III (64 entry TLB)
  305 + mmu_us_3, // Ultrasparc III (512 entry TLB)
  306 + mmu_us_4, // Ultrasparc IV (several TLBs, 32 and 256MB pages)
  307 + mmu_sun4v, // T1, T2
  308 +};
299 #endif 309 #endif
300 310
301 #if defined(TARGET_SPARC64) 311 #if defined(TARGET_SPARC64)
target-sparc/helper.c
@@ -758,7 +758,8 @@ void do_interrupt(CPUState *env) @@ -758,7 +758,8 @@ void do_interrupt(CPUState *env)
758 env->tsptr->tpc = env->pc; 758 env->tsptr->tpc = env->pc;
759 env->tsptr->tnpc = env->npc; 759 env->tsptr->tnpc = env->npc;
760 env->tsptr->tt = intno; 760 env->tsptr->tt = intno;
761 - change_pstate(PS_PEF | PS_PRIV | PS_AG); 761 + if (!(env->features & CPU_FEATURE_GL))
  762 + change_pstate(PS_PEF | PS_PRIV | PS_AG);
762 763
763 if (intno == TT_CLRWIN) 764 if (intno == TT_CLRWIN)
764 cpu_set_cwp(env, cpu_cwp_dec(env, env->cwp - 1)); 765 cpu_set_cwp(env, cpu_cwp_dec(env, env->cwp - 1));
@@ -934,6 +935,7 @@ static int cpu_sparc_register(CPUSPARCState *env, const char *cpu_model) @@ -934,6 +935,7 @@ static int cpu_sparc_register(CPUSPARCState *env, const char *cpu_model)
934 env->mmuregs[0] |= def->mmu_version; 935 env->mmuregs[0] |= def->mmu_version;
935 cpu_sparc_set_id(env, 0); 936 cpu_sparc_set_id(env, 0);
936 #else 937 #else
  938 + env->mmu_version = def->mmu_version;
937 env->version |= def->nwindows - 1; 939 env->version |= def->nwindows - 1;
938 #endif 940 #endif
939 return 0; 941 return 0;
@@ -978,7 +980,7 @@ static const sparc_def_t sparc_defs[] = { @@ -978,7 +980,7 @@ static const sparc_def_t sparc_defs[] = {
978 .iu_version = ((0x04ULL << 48) | (0x02ULL << 32) | (0ULL << 24) 980 .iu_version = ((0x04ULL << 48) | (0x02ULL << 32) | (0ULL << 24)
979 | (MAXTL << 8)), 981 | (MAXTL << 8)),
980 .fpu_version = 0x00000000, 982 .fpu_version = 0x00000000,
981 - .mmu_version = 0, 983 + .mmu_version = mmu_us_12,
982 .nwindows = 4, 984 .nwindows = 4,
983 .features = CPU_DEFAULT_FEATURES, 985 .features = CPU_DEFAULT_FEATURES,
984 }, 986 },
@@ -987,7 +989,7 @@ static const sparc_def_t sparc_defs[] = { @@ -987,7 +989,7 @@ static const sparc_def_t sparc_defs[] = {
987 .iu_version = ((0x04ULL << 48) | (0x03ULL << 32) | (0ULL << 24) 989 .iu_version = ((0x04ULL << 48) | (0x03ULL << 32) | (0ULL << 24)
988 | (MAXTL << 8)), 990 | (MAXTL << 8)),
989 .fpu_version = 0x00000000, 991 .fpu_version = 0x00000000,
990 - .mmu_version = 0, 992 + .mmu_version = mmu_us_12,
991 .nwindows = 5, 993 .nwindows = 5,
992 .features = CPU_DEFAULT_FEATURES, 994 .features = CPU_DEFAULT_FEATURES,
993 }, 995 },
@@ -996,7 +998,7 @@ static const sparc_def_t sparc_defs[] = { @@ -996,7 +998,7 @@ static const sparc_def_t sparc_defs[] = {
996 .iu_version = ((0x04ULL << 48) | (0x04ULL << 32) | (0ULL << 24) 998 .iu_version = ((0x04ULL << 48) | (0x04ULL << 32) | (0ULL << 24)
997 | (MAXTL << 8)), 999 | (MAXTL << 8)),
998 .fpu_version = 0x00000000, 1000 .fpu_version = 0x00000000,
999 - .mmu_version = 0, 1001 + .mmu_version = mmu_us_12,
1000 .nwindows = 8, 1002 .nwindows = 8,
1001 .features = CPU_DEFAULT_FEATURES, 1003 .features = CPU_DEFAULT_FEATURES,
1002 }, 1004 },
@@ -1005,7 +1007,7 @@ static const sparc_def_t sparc_defs[] = { @@ -1005,7 +1007,7 @@ static const sparc_def_t sparc_defs[] = {
1005 .iu_version = ((0x04ULL << 48) | (0x05ULL << 32) | (0x51ULL << 24) 1007 .iu_version = ((0x04ULL << 48) | (0x05ULL << 32) | (0x51ULL << 24)
1006 | (MAXTL << 8)), 1008 | (MAXTL << 8)),
1007 .fpu_version = 0x00000000, 1009 .fpu_version = 0x00000000,
1008 - .mmu_version = 0, 1010 + .mmu_version = mmu_us_12,
1009 .nwindows = 8, 1011 .nwindows = 8,
1010 .features = CPU_DEFAULT_FEATURES, 1012 .features = CPU_DEFAULT_FEATURES,
1011 }, 1013 },
@@ -1014,7 +1016,7 @@ static const sparc_def_t sparc_defs[] = { @@ -1014,7 +1016,7 @@ static const sparc_def_t sparc_defs[] = {
1014 .iu_version = ((0x17ULL << 48) | (0x10ULL << 32) | (0x40ULL << 24) 1016 .iu_version = ((0x17ULL << 48) | (0x10ULL << 32) | (0x40ULL << 24)
1015 | (MAXTL << 8)), 1017 | (MAXTL << 8)),
1016 .fpu_version = 0x00000000, 1018 .fpu_version = 0x00000000,
1017 - .mmu_version = 0, 1019 + .mmu_version = mmu_us_12,
1018 .nwindows = 8, 1020 .nwindows = 8,
1019 .features = CPU_DEFAULT_FEATURES, 1021 .features = CPU_DEFAULT_FEATURES,
1020 }, 1022 },
@@ -1023,7 +1025,7 @@ static const sparc_def_t sparc_defs[] = { @@ -1023,7 +1025,7 @@ static const sparc_def_t sparc_defs[] = {
1023 .iu_version = ((0x17ULL << 48) | (0x11ULL << 32) | (0x20ULL << 24) 1025 .iu_version = ((0x17ULL << 48) | (0x11ULL << 32) | (0x20ULL << 24)
1024 | (MAXTL << 8)), 1026 | (MAXTL << 8)),
1025 .fpu_version = 0x00000000, 1027 .fpu_version = 0x00000000,
1026 - .mmu_version = 0, 1028 + .mmu_version = mmu_us_12,
1027 .nwindows = 8, 1029 .nwindows = 8,
1028 .features = CPU_DEFAULT_FEATURES, 1030 .features = CPU_DEFAULT_FEATURES,
1029 }, 1031 },
@@ -1032,7 +1034,7 @@ static const sparc_def_t sparc_defs[] = { @@ -1032,7 +1034,7 @@ static const sparc_def_t sparc_defs[] = {
1032 .iu_version = ((0x17ULL << 48) | (0x12ULL << 32) | (0x91ULL << 24) 1034 .iu_version = ((0x17ULL << 48) | (0x12ULL << 32) | (0x91ULL << 24)
1033 | (MAXTL << 8)), 1035 | (MAXTL << 8)),
1034 .fpu_version = 0x00000000, 1036 .fpu_version = 0x00000000,
1035 - .mmu_version = 0, 1037 + .mmu_version = mmu_us_12,
1036 .nwindows = 8, 1038 .nwindows = 8,
1037 .features = CPU_DEFAULT_FEATURES, 1039 .features = CPU_DEFAULT_FEATURES,
1038 }, 1040 },
@@ -1041,7 +1043,7 @@ static const sparc_def_t sparc_defs[] = { @@ -1041,7 +1043,7 @@ static const sparc_def_t sparc_defs[] = {
1041 .iu_version = ((0x17ULL << 48) | (0x13ULL << 32) | (0x14ULL << 24) 1043 .iu_version = ((0x17ULL << 48) | (0x13ULL << 32) | (0x14ULL << 24)
1042 | (MAXTL << 8)), 1044 | (MAXTL << 8)),
1043 .fpu_version = 0x00000000, 1045 .fpu_version = 0x00000000,
1044 - .mmu_version = 0, 1046 + .mmu_version = mmu_us_12,
1045 .nwindows = 8, 1047 .nwindows = 8,
1046 .features = CPU_DEFAULT_FEATURES, 1048 .features = CPU_DEFAULT_FEATURES,
1047 }, 1049 },
@@ -1050,7 +1052,7 @@ static const sparc_def_t sparc_defs[] = { @@ -1050,7 +1052,7 @@ static const sparc_def_t sparc_defs[] = {
1050 .iu_version = ((0x3eULL << 48) | (0x14ULL << 32) | (0x34ULL << 24) 1052 .iu_version = ((0x3eULL << 48) | (0x14ULL << 32) | (0x34ULL << 24)
1051 | (MAXTL << 8)), 1053 | (MAXTL << 8)),
1052 .fpu_version = 0x00000000, 1054 .fpu_version = 0x00000000,
1053 - .mmu_version = 0, 1055 + .mmu_version = mmu_us_12,
1054 .nwindows = 8, 1056 .nwindows = 8,
1055 .features = CPU_DEFAULT_FEATURES, 1057 .features = CPU_DEFAULT_FEATURES,
1056 }, 1058 },
@@ -1059,7 +1061,7 @@ static const sparc_def_t sparc_defs[] = { @@ -1059,7 +1061,7 @@ static const sparc_def_t sparc_defs[] = {
1059 .iu_version = ((0x3eULL << 48) | (0x15ULL << 32) | (0x41ULL << 24) 1061 .iu_version = ((0x3eULL << 48) | (0x15ULL << 32) | (0x41ULL << 24)
1060 | (MAXTL << 8)), 1062 | (MAXTL << 8)),
1061 .fpu_version = 0x00000000, 1063 .fpu_version = 0x00000000,
1062 - .mmu_version = 0, 1064 + .mmu_version = mmu_us_3,
1063 .nwindows = 8, 1065 .nwindows = 8,
1064 .features = CPU_DEFAULT_FEATURES, 1066 .features = CPU_DEFAULT_FEATURES,
1065 }, 1067 },
@@ -1068,7 +1070,7 @@ static const sparc_def_t sparc_defs[] = { @@ -1068,7 +1070,7 @@ static const sparc_def_t sparc_defs[] = {
1068 .iu_version = ((0x3eULL << 48) | (0x16ULL << 32) | (0x34ULL << 24) 1070 .iu_version = ((0x3eULL << 48) | (0x16ULL << 32) | (0x34ULL << 24)
1069 | (MAXTL << 8)), 1071 | (MAXTL << 8)),
1070 .fpu_version = 0x00000000, 1072 .fpu_version = 0x00000000,
1071 - .mmu_version = 0, 1073 + .mmu_version = mmu_us_12,
1072 .nwindows = 8, 1074 .nwindows = 8,
1073 .features = CPU_DEFAULT_FEATURES, 1075 .features = CPU_DEFAULT_FEATURES,
1074 }, 1076 },
@@ -1077,7 +1079,7 @@ static const sparc_def_t sparc_defs[] = { @@ -1077,7 +1079,7 @@ static const sparc_def_t sparc_defs[] = {
1077 .iu_version = ((0x3eULL << 48) | (0x18ULL << 32) | (0x31ULL << 24) 1079 .iu_version = ((0x3eULL << 48) | (0x18ULL << 32) | (0x31ULL << 24)
1078 | (MAXTL << 8)), 1080 | (MAXTL << 8)),
1079 .fpu_version = 0x00000000, 1081 .fpu_version = 0x00000000,
1080 - .mmu_version = 0, 1082 + .mmu_version = mmu_us_4,
1081 .nwindows = 8, 1083 .nwindows = 8,
1082 .features = CPU_DEFAULT_FEATURES, 1084 .features = CPU_DEFAULT_FEATURES,
1083 }, 1085 },
@@ -1086,16 +1088,16 @@ static const sparc_def_t sparc_defs[] = { @@ -1086,16 +1088,16 @@ static const sparc_def_t sparc_defs[] = {
1086 .iu_version = ((0x3eULL << 48) | (0x19ULL << 32) | (0x22ULL << 24) 1088 .iu_version = ((0x3eULL << 48) | (0x19ULL << 32) | (0x22ULL << 24)
1087 | (MAXTL << 8)), 1089 | (MAXTL << 8)),
1088 .fpu_version = 0x00000000, 1090 .fpu_version = 0x00000000,
1089 - .mmu_version = 0, 1091 + .mmu_version = mmu_us_12,
1090 .nwindows = 8, 1092 .nwindows = 8,
1091 - .features = CPU_DEFAULT_FEATURES, 1093 + .features = CPU_DEFAULT_FEATURES | CPU_FEATURE_CMT,
1092 }, 1094 },
1093 { 1095 {
1094 .name = "Sun UltraSparc IIIi+", 1096 .name = "Sun UltraSparc IIIi+",
1095 .iu_version = ((0x3eULL << 48) | (0x22ULL << 32) | (0ULL << 24) 1097 .iu_version = ((0x3eULL << 48) | (0x22ULL << 32) | (0ULL << 24)
1096 | (MAXTL << 8)), 1098 | (MAXTL << 8)),
1097 .fpu_version = 0x00000000, 1099 .fpu_version = 0x00000000,
1098 - .mmu_version = 0, 1100 + .mmu_version = mmu_us_3,
1099 .nwindows = 8, 1101 .nwindows = 8,
1100 .features = CPU_DEFAULT_FEATURES, 1102 .features = CPU_DEFAULT_FEATURES,
1101 }, 1103 },
@@ -1104,7 +1106,7 @@ static const sparc_def_t sparc_defs[] = { @@ -1104,7 +1106,7 @@ static const sparc_def_t sparc_defs[] = {
1104 .iu_version = ((0x22ULL << 48) | (0x10ULL << 32) | (0x40ULL << 24) 1106 .iu_version = ((0x22ULL << 48) | (0x10ULL << 32) | (0x40ULL << 24)
1105 | (MAXTL << 8)), 1107 | (MAXTL << 8)),
1106 .fpu_version = 0x00000000, 1108 .fpu_version = 0x00000000,
1107 - .mmu_version = 0, 1109 + .mmu_version = mmu_us_12,
1108 .nwindows = 8, 1110 .nwindows = 8,
1109 .features = CPU_DEFAULT_FEATURES, 1111 .features = CPU_DEFAULT_FEATURES,
1110 }, 1112 },
@@ -1417,6 +1419,9 @@ static const char * const feature_name[] = { @@ -1417,6 +1419,9 @@ static const char * const feature_name[] = {
1417 "vis1", 1419 "vis1",
1418 "vis2", 1420 "vis2",
1419 "fsmuld", 1421 "fsmuld",
  1422 + "hypv",
  1423 + "cmt",
  1424 + "gl",
1420 }; 1425 };
1421 1426
1422 static void print_features(FILE *f, 1427 static void print_features(FILE *f,
target-sparc/op_helper.c
@@ -1549,7 +1549,8 @@ uint64_t helper_ld_asi(target_ulong addr, int asi, int size, int sign) @@ -1549,7 +1549,8 @@ uint64_t helper_ld_asi(target_ulong addr, int asi, int size, int sign)
1549 #endif 1549 #endif
1550 1550
1551 if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0) 1551 if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0)
1552 - || (asi >= 0x30 && asi < 0x80 && !(env->hpstate & HS_PRIV))) 1552 + || ((env->features & CPU_FEATURE_HYPV) && asi >= 0x30 && asi < 0x80
  1553 + && !(env->hpstate & HS_PRIV)))
1553 raise_exception(TT_PRIV_ACT); 1554 raise_exception(TT_PRIV_ACT);
1554 1555
1555 helper_check_align(addr, size - 1); 1556 helper_check_align(addr, size - 1);
@@ -1561,7 +1562,7 @@ uint64_t helper_ld_asi(target_ulong addr, int asi, int size, int sign) @@ -1561,7 +1562,7 @@ uint64_t helper_ld_asi(target_ulong addr, int asi, int size, int sign)
1561 case 0x88: // Primary LE 1562 case 0x88: // Primary LE
1562 case 0x8a: // Primary no-fault LE 1563 case 0x8a: // Primary no-fault LE
1563 if ((asi & 0x80) && (env->pstate & PS_PRIV)) { 1564 if ((asi & 0x80) && (env->pstate & PS_PRIV)) {
1564 - if (env->hpstate & HS_PRIV) { 1565 + if ((env->features & CPU_FEATURE_HYPV) && env->hpstate & HS_PRIV) {
1565 switch(size) { 1566 switch(size) {
1566 case 1: 1567 case 1:
1567 ret = ldub_hypv(addr); 1568 ret = ldub_hypv(addr);
@@ -1837,7 +1838,8 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size) @@ -1837,7 +1838,8 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size)
1837 dump_asi("write", addr, asi, size, val); 1838 dump_asi("write", addr, asi, size, val);
1838 #endif 1839 #endif
1839 if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0) 1840 if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0)
1840 - || (asi >= 0x30 && asi < 0x80 && !(env->hpstate & HS_PRIV))) 1841 + || ((env->features & CPU_FEATURE_HYPV) && asi >= 0x30 && asi < 0x80
  1842 + && !(env->hpstate & HS_PRIV)))
1841 raise_exception(TT_PRIV_ACT); 1843 raise_exception(TT_PRIV_ACT);
1842 1844
1843 helper_check_align(addr, size - 1); 1845 helper_check_align(addr, size - 1);
@@ -1873,7 +1875,7 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size) @@ -1873,7 +1875,7 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size)
1873 case 0x80: // Primary 1875 case 0x80: // Primary
1874 case 0x88: // Primary LE 1876 case 0x88: // Primary LE
1875 if ((asi & 0x80) && (env->pstate & PS_PRIV)) { 1877 if ((asi & 0x80) && (env->pstate & PS_PRIV)) {
1876 - if (env->hpstate & HS_PRIV) { 1878 + if ((env->features & CPU_FEATURE_HYPV) && env->hpstate & HS_PRIV) {
1877 switch(size) { 1879 switch(size) {
1878 case 1: 1880 case 1:
1879 stb_hypv(addr, val); 1881 stb_hypv(addr, val);
@@ -2153,7 +2155,8 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size) @@ -2153,7 +2155,8 @@ void helper_st_asi(target_ulong addr, target_ulong val, int asi, int size)
2153 void helper_ldda_asi(target_ulong addr, int asi, int rd) 2155 void helper_ldda_asi(target_ulong addr, int asi, int rd)
2154 { 2156 {
2155 if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0) 2157 if ((asi < 0x80 && (env->pstate & PS_PRIV) == 0)
2156 - || (asi >= 0x30 && asi < 0x80 && !(env->hpstate & HS_PRIV))) 2158 + || ((env->features & CPU_FEATURE_HYPV) && asi >= 0x30 && asi < 0x80
  2159 + && !(env->hpstate & HS_PRIV)))
2157 raise_exception(TT_PRIV_ACT); 2160 raise_exception(TT_PRIV_ACT);
2158 2161
2159 switch (asi) { 2162 switch (asi) {
@@ -2726,7 +2729,8 @@ void change_pstate(uint64_t new_pstate) @@ -2726,7 +2729,8 @@ void change_pstate(uint64_t new_pstate)
2726 2729
2727 void helper_wrpstate(target_ulong new_state) 2730 void helper_wrpstate(target_ulong new_state)
2728 { 2731 {
2729 - change_pstate(new_state & 0xf3f); 2732 + if (!(env->features & CPU_FEATURE_GL))
  2733 + change_pstate(new_state & 0xf3f);
2730 } 2734 }
2731 2735
2732 void helper_done(void) 2736 void helper_done(void)
target-sparc/translate.c
@@ -2175,6 +2175,7 @@ static void disas_sparc_insn(DisasContext * dc) @@ -2175,6 +2175,7 @@ static void disas_sparc_insn(DisasContext * dc)
2175 goto priv_insn; 2175 goto priv_insn;
2176 tcg_gen_helper_1_0(helper_rdpsr, cpu_dst); 2176 tcg_gen_helper_1_0(helper_rdpsr, cpu_dst);
2177 #else 2177 #else
  2178 + CHECK_IU_FEATURE(dc, HYPV);
2178 if (!hypervisor(dc)) 2179 if (!hypervisor(dc))
2179 goto priv_insn; 2180 goto priv_insn;
2180 rs1 = GET_FIELD(insn, 13, 17); 2181 rs1 = GET_FIELD(insn, 13, 17);
@@ -2325,11 +2326,13 @@ static void disas_sparc_insn(DisasContext * dc) @@ -2325,11 +2326,13 @@ static void disas_sparc_insn(DisasContext * dc)
2325 tcg_gen_ext_i32_tl(cpu_tmp0, cpu_tmp32); 2326 tcg_gen_ext_i32_tl(cpu_tmp0, cpu_tmp32);
2326 break; 2327 break;
2327 case 16: // UA2005 gl 2328 case 16: // UA2005 gl
  2329 + CHECK_IU_FEATURE(dc, GL);
2328 tcg_gen_ld_i32(cpu_tmp32, cpu_env, 2330 tcg_gen_ld_i32(cpu_tmp32, cpu_env,
2329 offsetof(CPUSPARCState, gl)); 2331 offsetof(CPUSPARCState, gl));
2330 tcg_gen_ext_i32_tl(cpu_tmp0, cpu_tmp32); 2332 tcg_gen_ext_i32_tl(cpu_tmp0, cpu_tmp32);
2331 break; 2333 break;
2332 case 26: // UA2005 strand status 2334 case 26: // UA2005 strand status
  2335 + CHECK_IU_FEATURE(dc, HYPV);
2333 if (!hypervisor(dc)) 2336 if (!hypervisor(dc))
2334 goto priv_insn; 2337 goto priv_insn;
2335 tcg_gen_ld_i32(cpu_tmp32, cpu_env, 2338 tcg_gen_ld_i32(cpu_tmp32, cpu_env,
@@ -3431,11 +3434,13 @@ static void disas_sparc_insn(DisasContext * dc) @@ -3431,11 +3434,13 @@ static void disas_sparc_insn(DisasContext * dc)
3431 wstate)); 3434 wstate));
3432 break; 3435 break;
3433 case 16: // UA2005 gl 3436 case 16: // UA2005 gl
  3437 + CHECK_IU_FEATURE(dc, GL);
3434 tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_tmp0); 3438 tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_tmp0);
3435 tcg_gen_st_i32(cpu_tmp32, cpu_env, 3439 tcg_gen_st_i32(cpu_tmp32, cpu_env,
3436 offsetof(CPUSPARCState, gl)); 3440 offsetof(CPUSPARCState, gl));
3437 break; 3441 break;
3438 case 26: // UA2005 strand status 3442 case 26: // UA2005 strand status
  3443 + CHECK_IU_FEATURE(dc, HYPV);
3439 if (!hypervisor(dc)) 3444 if (!hypervisor(dc))
3440 goto priv_insn; 3445 goto priv_insn;
3441 tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_tmp0); 3446 tcg_gen_trunc_tl_i32(cpu_tmp32, cpu_tmp0);
@@ -3461,6 +3466,7 @@ static void disas_sparc_insn(DisasContext * dc) @@ -3461,6 +3466,7 @@ static void disas_sparc_insn(DisasContext * dc)
3461 tcg_gen_st_tl(cpu_tmp0, cpu_env, 3466 tcg_gen_st_tl(cpu_tmp0, cpu_env,
3462 offsetof(CPUSPARCState, tbr)); 3467 offsetof(CPUSPARCState, tbr));
3463 #else 3468 #else
  3469 + CHECK_IU_FEATURE(dc, HYPV);
3464 if (!hypervisor(dc)) 3470 if (!hypervisor(dc))
3465 goto priv_insn; 3471 goto priv_insn;
3466 tcg_gen_xor_tl(cpu_tmp0, cpu_src1, cpu_src2); 3472 tcg_gen_xor_tl(cpu_tmp0, cpu_src1, cpu_src2);