@@ -439,10 +439,17 @@ static bool check_ptrace_values_sve(pid_t child, struct test_config *config)
439
439
pass = false;
440
440
}
441
441
442
- if (sve -> size != SVE_PT_SIZE (vq , sve -> flags )) {
443
- ksft_print_msg ("Mismatch in SVE header size: %d != %lu\n" ,
444
- sve -> size , SVE_PT_SIZE (vq , sve -> flags ));
445
- pass = false;
442
+ if (svcr_in & SVCR_SM ) {
443
+ if (sve -> size != sizeof (sve )) {
444
+ ksft_print_msg ("NT_ARM_SVE reports data with PSTATE.SM\n" );
445
+ pass = false;
446
+ }
447
+ } else {
448
+ if (sve -> size != SVE_PT_SIZE (vq , sve -> flags )) {
449
+ ksft_print_msg ("Mismatch in SVE header size: %d != %lu\n" ,
450
+ sve -> size , SVE_PT_SIZE (vq , sve -> flags ));
451
+ pass = false;
452
+ }
446
453
}
447
454
448
455
/* The registers might be in completely different formats! */
@@ -515,10 +522,17 @@ static bool check_ptrace_values_ssve(pid_t child, struct test_config *config)
515
522
pass = false;
516
523
}
517
524
518
- if (sve -> size != SVE_PT_SIZE (vq , sve -> flags )) {
519
- ksft_print_msg ("Mismatch in SSVE header size: %d != %lu\n" ,
520
- sve -> size , SVE_PT_SIZE (vq , sve -> flags ));
521
- pass = false;
525
+ if (!(svcr_in & SVCR_SM )) {
526
+ if (sve -> size != sizeof (sve )) {
527
+ ksft_print_msg ("NT_ARM_SSVE reports data without PSTATE.SM\n" );
528
+ pass = false;
529
+ }
530
+ } else {
531
+ if (sve -> size != SVE_PT_SIZE (vq , sve -> flags )) {
532
+ ksft_print_msg ("Mismatch in SSVE header size: %d != %lu\n" ,
533
+ sve -> size , SVE_PT_SIZE (vq , sve -> flags ));
534
+ pass = false;
535
+ }
522
536
}
523
537
524
538
/* The registers might be in completely different formats! */
@@ -891,18 +905,11 @@ static void set_initial_values(struct test_config *config)
891
905
{
892
906
int vq = __sve_vq_from_vl (vl_in (config ));
893
907
int sme_vq = __sve_vq_from_vl (config -> sme_vl_in );
894
- bool sm_change ;
895
908
896
909
svcr_in = config -> svcr_in ;
897
910
svcr_expected = config -> svcr_expected ;
898
911
svcr_out = 0 ;
899
912
900
- if (sme_supported () &&
901
- (svcr_in & SVCR_SM ) != (svcr_expected & SVCR_SM ))
902
- sm_change = true;
903
- else
904
- sm_change = false;
905
-
906
913
fill_random (& v_in , sizeof (v_in ));
907
914
memcpy (v_expected , v_in , sizeof (v_in ));
908
915
memset (v_out , 0 , sizeof (v_out ));
@@ -953,12 +960,7 @@ static void set_initial_values(struct test_config *config)
953
960
if (fpmr_supported ()) {
954
961
fill_random (& fpmr_in , sizeof (fpmr_in ));
955
962
fpmr_in &= FPMR_SAFE_BITS ;
956
-
957
- /* Entering or exiting streaming mode clears FPMR */
958
- if (sm_change )
959
- fpmr_expected = 0 ;
960
- else
961
- fpmr_expected = fpmr_in ;
963
+ fpmr_expected = fpmr_in ;
962
964
} else {
963
965
fpmr_in = 0 ;
964
966
fpmr_expected = 0 ;
@@ -1195,18 +1197,8 @@ static void sve_write(pid_t child, struct test_config *config)
1195
1197
1196
1198
static bool za_write_supported (struct test_config * config )
1197
1199
{
1198
- if (config -> sme_vl_in != config -> sme_vl_expected ) {
1199
- /* Changing the SME VL exits streaming mode. */
1200
- if (config -> svcr_expected & SVCR_SM ) {
1201
- return false;
1202
- }
1203
- } else {
1204
- /* Otherwise we can't change streaming mode */
1205
- if ((config -> svcr_in & SVCR_SM ) !=
1206
- (config -> svcr_expected & SVCR_SM )) {
1207
- return false;
1208
- }
1209
- }
1200
+ if ((config -> svcr_in & SVCR_SM ) != (config -> svcr_expected & SVCR_SM ))
1201
+ return false;
1210
1202
1211
1203
return true;
1212
1204
}
@@ -1224,10 +1216,8 @@ static void za_write_expected(struct test_config *config)
1224
1216
memset (zt_expected , 0 , sizeof (zt_expected ));
1225
1217
}
1226
1218
1227
- /* Changing the SME VL flushes ZT, SVE state and exits SM */
1219
+ /* Changing the SME VL flushes ZT, SVE state */
1228
1220
if (config -> sme_vl_in != config -> sme_vl_expected ) {
1229
- svcr_expected &= ~SVCR_SM ;
1230
-
1231
1221
sve_vq = __sve_vq_from_vl (vl_expected (config ));
1232
1222
memset (z_expected , 0 , __SVE_ZREGS_SIZE (sve_vq ));
1233
1223
memset (p_expected , 0 , __SVE_PREGS_SIZE (sve_vq ));
0 commit comments