Commit 926e862
arm64/signal: Silence sparse warning storing GCSPR_EL0
We are seeing a sparse warning in gcs_restore_signal():
arch/arm64/kernel/signal.c:1054:9: sparse: sparse: cast removes address space '__user' of expression
when storing the final GCSPR_EL0 value back into the register, caused by
the fact that write_sysreg_s() casts the value it writes to a u64 which
sparse sees as discarding the __userness of the pointer.
Avoid this by treating the address as an integer, casting to a pointer only
when using it to write to userspace.
While we're at it also inline gcs_signal_cap_valid() into it's one user
and make equivalent updates to gcs_signal_entry().
Reported-by: kernel test robot <[email protected]>
Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/
Signed-off-by: Mark Brown <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Catalin Marinas <[email protected]>1 parent ce03573 commit 926e862
1 file changed
+15
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | 39 | | |
41 | 40 | | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | 41 | | |
49 | 42 | | |
50 | 43 | | |
| |||
1062 | 1055 | | |
1063 | 1056 | | |
1064 | 1057 | | |
1065 | | - | |
1066 | | - | |
| 1058 | + | |
1067 | 1059 | | |
1068 | 1060 | | |
1069 | 1061 | | |
| |||
1072 | 1064 | | |
1073 | 1065 | | |
1074 | 1066 | | |
1075 | | - | |
| 1067 | + | |
1076 | 1068 | | |
1077 | 1069 | | |
1078 | 1070 | | |
| |||
1087 | 1079 | | |
1088 | 1080 | | |
1089 | 1081 | | |
1090 | | - | |
| 1082 | + | |
| 1083 | + | |
1091 | 1084 | | |
1092 | 1085 | | |
1093 | 1086 | | |
1094 | 1087 | | |
1095 | 1088 | | |
1096 | 1089 | | |
1097 | | - | |
| 1090 | + | |
1098 | 1091 | | |
1099 | 1092 | | |
1100 | 1093 | | |
1101 | | - | |
| 1094 | + | |
1102 | 1095 | | |
1103 | 1096 | | |
1104 | 1097 | | |
1105 | | - | |
| 1098 | + | |
1106 | 1099 | | |
1107 | 1100 | | |
1108 | 1101 | | |
| |||
1421 | 1414 | | |
1422 | 1415 | | |
1423 | 1416 | | |
1424 | | - | |
| 1417 | + | |
1425 | 1418 | | |
1426 | 1419 | | |
1427 | 1420 | | |
| |||
1434 | 1427 | | |
1435 | 1428 | | |
1436 | 1429 | | |
1437 | | - | |
| 1430 | + | |
1438 | 1431 | | |
1439 | 1432 | | |
1440 | 1433 | | |
1441 | 1434 | | |
1442 | | - | |
1443 | | - | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
1444 | 1439 | | |
1445 | 1440 | | |
1446 | 1441 | | |
1447 | | - | |
1448 | | - | |
| 1442 | + | |
| 1443 | + | |
1449 | 1444 | | |
1450 | 1445 | | |
1451 | 1446 | | |
| |||
0 commit comments