@@ -1046,7 +1046,6 @@ static void fetch_register_operand(struct operand *op)
1046
1046
1047
1047
static void read_sse_reg (struct x86_emulate_ctxt * ctxt , sse128_t * data , int reg )
1048
1048
{
1049
- ctxt -> ops -> get_fpu (ctxt );
1050
1049
switch (reg ) {
1051
1050
case 0 : asm("movdqa %%xmm0, %0" : "=m" (* data )); break ;
1052
1051
case 1 : asm("movdqa %%xmm1, %0" : "=m" (* data )); break ;
@@ -1068,13 +1067,11 @@ static void read_sse_reg(struct x86_emulate_ctxt *ctxt, sse128_t *data, int reg)
1068
1067
#endif
1069
1068
default : BUG ();
1070
1069
}
1071
- ctxt -> ops -> put_fpu (ctxt );
1072
1070
}
1073
1071
1074
1072
static void write_sse_reg (struct x86_emulate_ctxt * ctxt , sse128_t * data ,
1075
1073
int reg )
1076
1074
{
1077
- ctxt -> ops -> get_fpu (ctxt );
1078
1075
switch (reg ) {
1079
1076
case 0 : asm("movdqa %0, %%xmm0" : : "m" (* data )); break ;
1080
1077
case 1 : asm("movdqa %0, %%xmm1" : : "m" (* data )); break ;
@@ -1096,12 +1093,10 @@ static void write_sse_reg(struct x86_emulate_ctxt *ctxt, sse128_t *data,
1096
1093
#endif
1097
1094
default : BUG ();
1098
1095
}
1099
- ctxt -> ops -> put_fpu (ctxt );
1100
1096
}
1101
1097
1102
1098
static void read_mmx_reg (struct x86_emulate_ctxt * ctxt , u64 * data , int reg )
1103
1099
{
1104
- ctxt -> ops -> get_fpu (ctxt );
1105
1100
switch (reg ) {
1106
1101
case 0 : asm("movq %%mm0, %0" : "=m" (* data )); break ;
1107
1102
case 1 : asm("movq %%mm1, %0" : "=m" (* data )); break ;
@@ -1113,12 +1108,10 @@ static void read_mmx_reg(struct x86_emulate_ctxt *ctxt, u64 *data, int reg)
1113
1108
case 7 : asm("movq %%mm7, %0" : "=m" (* data )); break ;
1114
1109
default : BUG ();
1115
1110
}
1116
- ctxt -> ops -> put_fpu (ctxt );
1117
1111
}
1118
1112
1119
1113
static void write_mmx_reg (struct x86_emulate_ctxt * ctxt , u64 * data , int reg )
1120
1114
{
1121
- ctxt -> ops -> get_fpu (ctxt );
1122
1115
switch (reg ) {
1123
1116
case 0 : asm("movq %0, %%mm0" : : "m" (* data )); break ;
1124
1117
case 1 : asm("movq %0, %%mm1" : : "m" (* data )); break ;
@@ -1130,17 +1123,14 @@ static void write_mmx_reg(struct x86_emulate_ctxt *ctxt, u64 *data, int reg)
1130
1123
case 7 : asm("movq %0, %%mm7" : : "m" (* data )); break ;
1131
1124
default : BUG ();
1132
1125
}
1133
- ctxt -> ops -> put_fpu (ctxt );
1134
1126
}
1135
1127
1136
1128
static int em_fninit (struct x86_emulate_ctxt * ctxt )
1137
1129
{
1138
1130
if (ctxt -> ops -> get_cr (ctxt , 0 ) & (X86_CR0_TS | X86_CR0_EM ))
1139
1131
return emulate_nm (ctxt );
1140
1132
1141
- ctxt -> ops -> get_fpu (ctxt );
1142
1133
asm volatile ("fninit" );
1143
- ctxt -> ops -> put_fpu (ctxt );
1144
1134
return X86EMUL_CONTINUE ;
1145
1135
}
1146
1136
@@ -1151,9 +1141,7 @@ static int em_fnstcw(struct x86_emulate_ctxt *ctxt)
1151
1141
if (ctxt -> ops -> get_cr (ctxt , 0 ) & (X86_CR0_TS | X86_CR0_EM ))
1152
1142
return emulate_nm (ctxt );
1153
1143
1154
- ctxt -> ops -> get_fpu (ctxt );
1155
1144
asm volatile ("fnstcw %0" : "+m" (fcw ));
1156
- ctxt -> ops -> put_fpu (ctxt );
1157
1145
1158
1146
ctxt -> dst .val = fcw ;
1159
1147
@@ -1167,9 +1155,7 @@ static int em_fnstsw(struct x86_emulate_ctxt *ctxt)
1167
1155
if (ctxt -> ops -> get_cr (ctxt , 0 ) & (X86_CR0_TS | X86_CR0_EM ))
1168
1156
return emulate_nm (ctxt );
1169
1157
1170
- ctxt -> ops -> get_fpu (ctxt );
1171
1158
asm volatile ("fnstsw %0" : "+m" (fsw ));
1172
- ctxt -> ops -> put_fpu (ctxt );
1173
1159
1174
1160
ctxt -> dst .val = fsw ;
1175
1161
@@ -4001,12 +3987,8 @@ static int em_fxsave(struct x86_emulate_ctxt *ctxt)
4001
3987
if (rc != X86EMUL_CONTINUE )
4002
3988
return rc ;
4003
3989
4004
- ctxt -> ops -> get_fpu (ctxt );
4005
-
4006
3990
rc = asm_safe ("fxsave %[fx]" , , [fx ] "+m" (fx_state ));
4007
3991
4008
- ctxt -> ops -> put_fpu (ctxt );
4009
-
4010
3992
if (rc != X86EMUL_CONTINUE )
4011
3993
return rc ;
4012
3994
@@ -4049,8 +4031,6 @@ static int em_fxrstor(struct x86_emulate_ctxt *ctxt)
4049
4031
if (rc != X86EMUL_CONTINUE )
4050
4032
return rc ;
4051
4033
4052
- ctxt -> ops -> get_fpu (ctxt );
4053
-
4054
4034
if (size < __fxstate_size (16 )) {
4055
4035
rc = fxregs_fixup (& fx_state , size );
4056
4036
if (rc != X86EMUL_CONTINUE )
@@ -4066,8 +4046,6 @@ static int em_fxrstor(struct x86_emulate_ctxt *ctxt)
4066
4046
rc = asm_safe ("fxrstor %[fx]" , : [fx ] "m" (fx_state ));
4067
4047
4068
4048
out :
4069
- ctxt -> ops -> put_fpu (ctxt );
4070
-
4071
4049
return rc ;
4072
4050
}
4073
4051
@@ -5317,9 +5295,7 @@ static int flush_pending_x87_faults(struct x86_emulate_ctxt *ctxt)
5317
5295
{
5318
5296
int rc ;
5319
5297
5320
- ctxt -> ops -> get_fpu (ctxt );
5321
5298
rc = asm_safe ("fwait" );
5322
- ctxt -> ops -> put_fpu (ctxt );
5323
5299
5324
5300
if (unlikely (rc != X86EMUL_CONTINUE ))
5325
5301
return emulate_exception (ctxt , MF_VECTOR , 0 , false);
0 commit comments