Commit ab51225
vhost: Don't call log_access_ok() when using IOTLB
When the IOTLB device is enabled, the log_guest_addr that is passed by
userspace to the VHOST_SET_VRING_ADDR ioctl, and which is then written
to vq->log_addr, is a GIOVA. All writes to this address are translated
by log_user() to writes to an HVA, and then ultimately logged through
the corresponding GPAs in log_write_hva(). No logging will ever occur
with vq->log_addr in this case. It is thus wrong to pass vq->log_addr
and log_guest_addr to log_access_vq() which assumes they are actual
GPAs.
Introduce a new vq_log_used_access_ok() helper that only checks accesses
to the log for the used structure when there isn't an IOTLB device around.
Signed-off-by: Greg Kurz <groug@kaod.org>
Link: https://lore.kernel.org/r/160171933385.284610.10189082586063280867.stgit@bahia.lan
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>1 parent 71878fa commit ab51225
1 file changed
Lines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1370 | 1370 | | |
1371 | 1371 | | |
1372 | 1372 | | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
1373 | 1387 | | |
1374 | 1388 | | |
1375 | 1389 | | |
1376 | 1390 | | |
1377 | 1391 | | |
1378 | 1392 | | |
1379 | 1393 | | |
1380 | | - | |
1381 | | - | |
| 1394 | + | |
1382 | 1395 | | |
1383 | 1396 | | |
1384 | 1397 | | |
| |||
1517 | 1530 | | |
1518 | 1531 | | |
1519 | 1532 | | |
1520 | | - | |
1521 | | - | |
1522 | | - | |
| 1533 | + | |
| 1534 | + | |
| 1535 | + | |
1523 | 1536 | | |
1524 | 1537 | | |
1525 | 1538 | | |
| |||
0 commit comments