Commit 309bba3
vringh: iterate on iotlb_translate to handle large translations
iotlb_translate() can return -ENOBUFS if the bio_vec is not big enough
to contain all the ranges for translation.
This can happen for example if the VMM maps a large bounce buffer,
without using hugepages, that requires more than 16 ranges to translate
the addresses.
To handle this case, let's extend iotlb_translate() to also return the
number of bytes successfully translated.
In copy_from_iotlb()/copy_to_iotlb() loops by calling iotlb_translate()
several times until we complete the translation.
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Message-Id: <20220624075656.13997-1-sgarzare@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>1 parent 96ef18a commit 309bba3
1 file changed
+56
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1095 | 1095 | | |
1096 | 1096 | | |
1097 | 1097 | | |
1098 | | - | |
| 1098 | + | |
| 1099 | + | |
1099 | 1100 | | |
1100 | 1101 | | |
1101 | 1102 | | |
| |||
1136 | 1137 | | |
1137 | 1138 | | |
1138 | 1139 | | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
1139 | 1143 | | |
1140 | 1144 | | |
1141 | 1145 | | |
1142 | 1146 | | |
1143 | 1147 | | |
1144 | 1148 | | |
1145 | | - | |
1146 | | - | |
1147 | | - | |
| 1149 | + | |
1148 | 1150 | | |
1149 | | - | |
1150 | | - | |
1151 | | - | |
1152 | | - | |
| 1151 | + | |
| 1152 | + | |
| 1153 | + | |
| 1154 | + | |
| 1155 | + | |
1153 | 1156 | | |
1154 | | - | |
| 1157 | + | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
| 1163 | + | |
1155 | 1164 | | |
1156 | | - | |
| 1165 | + | |
1157 | 1166 | | |
1158 | | - | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
| 1176 | + | |
1159 | 1177 | | |
1160 | 1178 | | |
1161 | 1179 | | |
1162 | 1180 | | |
1163 | 1181 | | |
1164 | | - | |
1165 | | - | |
1166 | | - | |
| 1182 | + | |
1167 | 1183 | | |
1168 | | - | |
1169 | | - | |
1170 | | - | |
1171 | | - | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
1172 | 1197 | | |
1173 | | - | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
1174 | 1208 | | |
1175 | | - | |
| 1209 | + | |
1176 | 1210 | | |
1177 | 1211 | | |
1178 | 1212 | | |
| |||
1183 | 1217 | | |
1184 | 1218 | | |
1185 | 1219 | | |
1186 | | - | |
| 1220 | + | |
1187 | 1221 | | |
1188 | 1222 | | |
1189 | 1223 | | |
| |||
1204 | 1238 | | |
1205 | 1239 | | |
1206 | 1240 | | |
1207 | | - | |
| 1241 | + | |
1208 | 1242 | | |
1209 | 1243 | | |
1210 | 1244 | | |
| |||
0 commit comments