Lines Matching full:sregs

185     struct kvm_sregs sregs;  in kvm_arch_sync_sregs()  local
204 ret = kvm_vcpu_ioctl(cs, KVM_GET_SREGS, &sregs); in kvm_arch_sync_sregs()
209 sregs.pvr = cenv->spr[SPR_PVR]; in kvm_arch_sync_sregs()
210 return kvm_vcpu_ioctl(cs, KVM_SET_SREGS, &sregs); in kvm_arch_sync_sregs()
486 /* Synchronize sregs with kvm */ in kvm_arch_init_vcpu()
864 struct kvm_sregs sregs = { }; in kvmppc_put_books_sregs() local
867 sregs.pvr = env->spr[SPR_PVR]; in kvmppc_put_books_sregs()
870 sregs.u.s.sdr1 = cpu->vhyp_class->encode_hpt_for_kvm_pr(cpu->vhyp); in kvmppc_put_books_sregs()
872 sregs.u.s.sdr1 = env->spr[SPR_SDR1]; in kvmppc_put_books_sregs()
878 sregs.u.s.ppc64.slb[i].slbe = env->slb[i].esid; in kvmppc_put_books_sregs()
880 sregs.u.s.ppc64.slb[i].slbe |= i; in kvmppc_put_books_sregs()
882 sregs.u.s.ppc64.slb[i].slbv = env->slb[i].vsid; in kvmppc_put_books_sregs()
888 sregs.u.s.ppc32.sr[i] = env->sr[i]; in kvmppc_put_books_sregs()
894 sregs.u.s.ppc32.dbat[i] = ((uint64_t)env->DBAT[0][i] << 32) in kvmppc_put_books_sregs()
896 sregs.u.s.ppc32.ibat[i] = ((uint64_t)env->IBAT[0][i] << 32) in kvmppc_put_books_sregs()
900 return kvm_vcpu_ioctl(CPU(cpu), KVM_SET_SREGS, &sregs); in kvmppc_put_books_sregs()
1025 struct kvm_sregs sregs; in kvmppc_get_booke_sregs() local
1028 ret = kvm_vcpu_ioctl(CPU(cpu), KVM_GET_SREGS, &sregs); in kvmppc_get_booke_sregs()
1033 if (sregs.u.e.features & KVM_SREGS_E_BASE) { in kvmppc_get_booke_sregs()
1034 env->spr[SPR_BOOKE_CSRR0] = sregs.u.e.csrr0; in kvmppc_get_booke_sregs()
1035 env->spr[SPR_BOOKE_CSRR1] = sregs.u.e.csrr1; in kvmppc_get_booke_sregs()
1036 env->spr[SPR_BOOKE_ESR] = sregs.u.e.esr; in kvmppc_get_booke_sregs()
1037 env->spr[SPR_BOOKE_DEAR] = sregs.u.e.dear; in kvmppc_get_booke_sregs()
1038 env->spr[SPR_BOOKE_MCSR] = sregs.u.e.mcsr; in kvmppc_get_booke_sregs()
1039 env->spr[SPR_BOOKE_TSR] = sregs.u.e.tsr; in kvmppc_get_booke_sregs()
1040 env->spr[SPR_BOOKE_TCR] = sregs.u.e.tcr; in kvmppc_get_booke_sregs()
1041 env->spr[SPR_DECR] = sregs.u.e.dec; in kvmppc_get_booke_sregs()
1042 env->spr[SPR_TBL] = sregs.u.e.tb & 0xffffffff; in kvmppc_get_booke_sregs()
1043 env->spr[SPR_TBU] = sregs.u.e.tb >> 32; in kvmppc_get_booke_sregs()
1044 env->spr[SPR_VRSAVE] = sregs.u.e.vrsave; in kvmppc_get_booke_sregs()
1047 if (sregs.u.e.features & KVM_SREGS_E_ARCH206) { in kvmppc_get_booke_sregs()
1048 env->spr[SPR_BOOKE_PIR] = sregs.u.e.pir; in kvmppc_get_booke_sregs()
1049 env->spr[SPR_BOOKE_MCSRR0] = sregs.u.e.mcsrr0; in kvmppc_get_booke_sregs()
1050 env->spr[SPR_BOOKE_MCSRR1] = sregs.u.e.mcsrr1; in kvmppc_get_booke_sregs()
1051 env->spr[SPR_BOOKE_DECAR] = sregs.u.e.decar; in kvmppc_get_booke_sregs()
1052 env->spr[SPR_BOOKE_IVPR] = sregs.u.e.ivpr; in kvmppc_get_booke_sregs()
1055 if (sregs.u.e.features & KVM_SREGS_E_64) { in kvmppc_get_booke_sregs()
1056 env->spr[SPR_BOOKE_EPCR] = sregs.u.e.epcr; in kvmppc_get_booke_sregs()
1059 if (sregs.u.e.features & KVM_SREGS_E_SPRG8) { in kvmppc_get_booke_sregs()
1060 env->spr[SPR_BOOKE_SPRG8] = sregs.u.e.sprg8; in kvmppc_get_booke_sregs()
1063 if (sregs.u.e.features & KVM_SREGS_E_IVOR) { in kvmppc_get_booke_sregs()
1064 env->spr[SPR_BOOKE_IVOR0] = sregs.u.e.ivor_low[0]; in kvmppc_get_booke_sregs()
1066 env->spr[SPR_BOOKE_IVOR1] = sregs.u.e.ivor_low[1]; in kvmppc_get_booke_sregs()
1068 env->spr[SPR_BOOKE_IVOR2] = sregs.u.e.ivor_low[2]; in kvmppc_get_booke_sregs()
1070 env->spr[SPR_BOOKE_IVOR3] = sregs.u.e.ivor_low[3]; in kvmppc_get_booke_sregs()
1072 env->spr[SPR_BOOKE_IVOR4] = sregs.u.e.ivor_low[4]; in kvmppc_get_booke_sregs()
1074 env->spr[SPR_BOOKE_IVOR5] = sregs.u.e.ivor_low[5]; in kvmppc_get_booke_sregs()
1076 env->spr[SPR_BOOKE_IVOR6] = sregs.u.e.ivor_low[6]; in kvmppc_get_booke_sregs()
1078 env->spr[SPR_BOOKE_IVOR7] = sregs.u.e.ivor_low[7]; in kvmppc_get_booke_sregs()
1080 env->spr[SPR_BOOKE_IVOR8] = sregs.u.e.ivor_low[8]; in kvmppc_get_booke_sregs()
1082 env->spr[SPR_BOOKE_IVOR9] = sregs.u.e.ivor_low[9]; in kvmppc_get_booke_sregs()
1084 env->spr[SPR_BOOKE_IVOR10] = sregs.u.e.ivor_low[10]; in kvmppc_get_booke_sregs()
1086 env->spr[SPR_BOOKE_IVOR11] = sregs.u.e.ivor_low[11]; in kvmppc_get_booke_sregs()
1088 env->spr[SPR_BOOKE_IVOR12] = sregs.u.e.ivor_low[12]; in kvmppc_get_booke_sregs()
1090 env->spr[SPR_BOOKE_IVOR13] = sregs.u.e.ivor_low[13]; in kvmppc_get_booke_sregs()
1092 env->spr[SPR_BOOKE_IVOR14] = sregs.u.e.ivor_low[14]; in kvmppc_get_booke_sregs()
1094 env->spr[SPR_BOOKE_IVOR15] = sregs.u.e.ivor_low[15]; in kvmppc_get_booke_sregs()
1097 if (sregs.u.e.features & KVM_SREGS_E_SPE) { in kvmppc_get_booke_sregs()
1098 env->spr[SPR_BOOKE_IVOR32] = sregs.u.e.ivor_high[0]; in kvmppc_get_booke_sregs()
1100 env->spr[SPR_BOOKE_IVOR33] = sregs.u.e.ivor_high[1]; in kvmppc_get_booke_sregs()
1102 env->spr[SPR_BOOKE_IVOR34] = sregs.u.e.ivor_high[2]; in kvmppc_get_booke_sregs()
1106 if (sregs.u.e.features & KVM_SREGS_E_PM) { in kvmppc_get_booke_sregs()
1107 env->spr[SPR_BOOKE_IVOR35] = sregs.u.e.ivor_high[3]; in kvmppc_get_booke_sregs()
1111 if (sregs.u.e.features & KVM_SREGS_E_PC) { in kvmppc_get_booke_sregs()
1112 env->spr[SPR_BOOKE_IVOR36] = sregs.u.e.ivor_high[4]; in kvmppc_get_booke_sregs()
1114 env->spr[SPR_BOOKE_IVOR37] = sregs.u.e.ivor_high[5]; in kvmppc_get_booke_sregs()
1119 if (sregs.u.e.features & KVM_SREGS_E_ARCH206_MMU) { in kvmppc_get_booke_sregs()
1120 env->spr[SPR_BOOKE_MAS0] = sregs.u.e.mas0; in kvmppc_get_booke_sregs()
1121 env->spr[SPR_BOOKE_MAS1] = sregs.u.e.mas1; in kvmppc_get_booke_sregs()
1122 env->spr[SPR_BOOKE_MAS2] = sregs.u.e.mas2; in kvmppc_get_booke_sregs()
1123 env->spr[SPR_BOOKE_MAS3] = sregs.u.e.mas7_3 & 0xffffffff; in kvmppc_get_booke_sregs()
1124 env->spr[SPR_BOOKE_MAS4] = sregs.u.e.mas4; in kvmppc_get_booke_sregs()
1125 env->spr[SPR_BOOKE_MAS6] = sregs.u.e.mas6; in kvmppc_get_booke_sregs()
1126 env->spr[SPR_BOOKE_MAS7] = sregs.u.e.mas7_3 >> 32; in kvmppc_get_booke_sregs()
1127 env->spr[SPR_MMUCFG] = sregs.u.e.mmucfg; in kvmppc_get_booke_sregs()
1128 env->spr[SPR_BOOKE_TLB0CFG] = sregs.u.e.tlbcfg[0]; in kvmppc_get_booke_sregs()
1129 env->spr[SPR_BOOKE_TLB1CFG] = sregs.u.e.tlbcfg[1]; in kvmppc_get_booke_sregs()
1132 if (sregs.u.e.features & KVM_SREGS_EXP) { in kvmppc_get_booke_sregs()
1133 env->spr[SPR_BOOKE_EPR] = sregs.u.e.epr; in kvmppc_get_booke_sregs()
1136 if (sregs.u.e.features & KVM_SREGS_E_PD) { in kvmppc_get_booke_sregs()
1137 env->spr[SPR_BOOKE_EPLC] = sregs.u.e.eplc; in kvmppc_get_booke_sregs()
1138 env->spr[SPR_BOOKE_EPSC] = sregs.u.e.epsc; in kvmppc_get_booke_sregs()
1141 if (sregs.u.e.impl_id == KVM_SREGS_E_IMPL_FSL) { in kvmppc_get_booke_sregs()
1142 env->spr[SPR_E500_SVR] = sregs.u.e.impl.fsl.svr; in kvmppc_get_booke_sregs()
1143 env->spr[SPR_Exxx_MCAR] = sregs.u.e.impl.fsl.mcar; in kvmppc_get_booke_sregs()
1144 env->spr[SPR_HID0] = sregs.u.e.impl.fsl.hid0; in kvmppc_get_booke_sregs()
1146 if (sregs.u.e.impl.fsl.features & KVM_SREGS_E_FSL_PIDn) { in kvmppc_get_booke_sregs()
1147 env->spr[SPR_BOOKE_PID1] = sregs.u.e.impl.fsl.pid1; in kvmppc_get_booke_sregs()
1148 env->spr[SPR_BOOKE_PID2] = sregs.u.e.impl.fsl.pid2; in kvmppc_get_booke_sregs()
1158 struct kvm_sregs sregs; in kvmppc_get_books_sregs() local
1162 ret = kvm_vcpu_ioctl(CPU(cpu), KVM_GET_SREGS, &sregs); in kvmppc_get_books_sregs()
1168 ppc_store_sdr1(env, sregs.u.s.sdr1); in kvmppc_get_books_sregs()
1181 target_ulong rb = sregs.u.s.ppc64.slb[i].slbe; in kvmppc_get_books_sregs()
1182 target_ulong rs = sregs.u.s.ppc64.slb[i].slbv; in kvmppc_get_books_sregs()
1194 env->sr[i] = sregs.u.s.ppc32.sr[i]; in kvmppc_get_books_sregs()
1199 env->DBAT[0][i] = sregs.u.s.ppc32.dbat[i] & 0xffffffff; in kvmppc_get_books_sregs()
1200 env->DBAT[1][i] = sregs.u.s.ppc32.dbat[i] >> 32; in kvmppc_get_books_sregs()
1201 env->IBAT[0][i] = sregs.u.s.ppc32.ibat[i] & 0xffffffff; in kvmppc_get_books_sregs()
1202 env->IBAT[1][i] = sregs.u.s.ppc32.ibat[i] >> 32; in kvmppc_get_books_sregs()