@@ -1153,25 +1153,17 @@ static unsigned int raz_visibility(const struct kvm_vcpu *vcpu,
1153
1153
1154
1154
/* cpufeature ID register access trap handlers */
1155
1155
1156
- static bool __access_id_reg (struct kvm_vcpu * vcpu ,
1157
- struct sys_reg_params * p ,
1158
- const struct sys_reg_desc * r ,
1159
- bool raz )
1160
- {
1161
- if (p -> is_write )
1162
- return write_to_read_only (vcpu , p , r );
1163
-
1164
- p -> regval = read_id_reg (vcpu , r , raz );
1165
- return true;
1166
- }
1167
-
1168
1156
static bool access_id_reg (struct kvm_vcpu * vcpu ,
1169
1157
struct sys_reg_params * p ,
1170
1158
const struct sys_reg_desc * r )
1171
1159
{
1172
1160
bool raz = sysreg_visible_as_raz (vcpu , r );
1173
1161
1174
- return __access_id_reg (vcpu , p , r , raz );
1162
+ if (p -> is_write )
1163
+ return write_to_read_only (vcpu , p , r );
1164
+
1165
+ p -> regval = read_id_reg (vcpu , r , raz );
1166
+ return true;
1175
1167
}
1176
1168
1177
1169
/* Visibility overrides for SVE-specific control registers */
@@ -1226,39 +1218,25 @@ static int set_id_aa64pfr0_el1(struct kvm_vcpu *vcpu,
1226
1218
* are stored, and for set_id_reg() we don't allow the effective value
1227
1219
* to be changed.
1228
1220
*/
1229
- static int __get_id_reg (const struct kvm_vcpu * vcpu ,
1230
- const struct sys_reg_desc * rd , u64 * val ,
1231
- bool raz )
1232
- {
1233
- * val = read_id_reg (vcpu , rd , raz );
1234
- return 0 ;
1235
- }
1236
-
1237
- static int __set_id_reg (const struct kvm_vcpu * vcpu ,
1238
- const struct sys_reg_desc * rd , u64 val ,
1239
- bool raz )
1240
- {
1241
- /* This is what we mean by invariant: you can't change it. */
1242
- if (val != read_id_reg (vcpu , rd , raz ))
1243
- return - EINVAL ;
1244
-
1245
- return 0 ;
1246
- }
1247
-
1248
1221
static int get_id_reg (struct kvm_vcpu * vcpu , const struct sys_reg_desc * rd ,
1249
1222
u64 * val )
1250
1223
{
1251
1224
bool raz = sysreg_visible_as_raz (vcpu , rd );
1252
1225
1253
- return __get_id_reg (vcpu , rd , val , raz );
1226
+ * val = read_id_reg (vcpu , rd , raz );
1227
+ return 0 ;
1254
1228
}
1255
1229
1256
1230
static int set_id_reg (struct kvm_vcpu * vcpu , const struct sys_reg_desc * rd ,
1257
1231
u64 val )
1258
1232
{
1259
1233
bool raz = sysreg_visible_as_raz (vcpu , rd );
1260
1234
1261
- return __set_id_reg (vcpu , rd , val , raz );
1235
+ /* This is what we mean by invariant: you can't change it. */
1236
+ if (val != read_id_reg (vcpu , rd , raz ))
1237
+ return - EINVAL ;
1238
+
1239
+ return 0 ;
1262
1240
}
1263
1241
1264
1242
static int get_raz_reg (struct kvm_vcpu * vcpu , const struct sys_reg_desc * rd ,
0 commit comments