Commit f91bb85
s390/zcrypt: Avoid alloc and copy of ep11 targets if kernelspace cprb
If there is a target list of APQNs given when an CPRB is
to be send via zcrypt_send_ep11_cprb() there is always a
kmalloc() done and the targets are copied via z_copy_from_user.
As there are callers from kernel space (zcrypt_ep11misc.c)
which signal this via the userspace parameter improve this
code to directly use the given target list in case of
kernelspace thus removing the unnecessary memory alloc
and mem copy.
Signed-off-by: Harald Freudenberger <freude@linux.ibm.com>
Reviewed-by: Holger Dengler <dengler@linux.ibm.com>
Link: https://lore.kernel.org/r/20250424133619.16495-5-freude@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>1 parent dcc160b commit f91bb85
1 file changed
Lines changed: 19 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1035 | 1035 | | |
1036 | 1036 | | |
1037 | 1037 | | |
1038 | | - | |
| 1038 | + | |
1039 | 1039 | | |
1040 | 1040 | | |
1041 | 1041 | | |
| |||
1052 | 1052 | | |
1053 | 1053 | | |
1054 | 1054 | | |
1055 | | - | |
| 1055 | + | |
1056 | 1056 | | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
1072 | 1068 | | |
1073 | 1069 | | |
1074 | 1070 | | |
1075 | 1071 | | |
1076 | 1072 | | |
1077 | | - | |
| 1073 | + | |
1078 | 1074 | | |
1079 | 1075 | | |
1080 | 1076 | | |
1081 | 1077 | | |
1082 | 1078 | | |
1083 | 1079 | | |
1084 | 1080 | | |
1085 | | - | |
| 1081 | + | |
1086 | 1082 | | |
1087 | 1083 | | |
1088 | 1084 | | |
1089 | | - | |
| 1085 | + | |
1090 | 1086 | | |
1091 | 1087 | | |
1092 | 1088 | | |
| |||
1154 | 1150 | | |
1155 | 1151 | | |
1156 | 1152 | | |
1157 | | - | |
| 1153 | + | |
1158 | 1154 | | |
1159 | 1155 | | |
1160 | 1156 | | |
| |||
1168 | 1164 | | |
1169 | 1165 | | |
1170 | 1166 | | |
1171 | | - | |
1172 | | - | |
1173 | 1167 | | |
| 1168 | + | |
| 1169 | + | |
1174 | 1170 | | |
1175 | 1171 | | |
1176 | 1172 | | |
| |||
0 commit comments