diff options
author | Greg Kurz <groug@kaod.org> | 2020-10-03 12:02:13 +0200 |
---|---|---|
committer | Michael S. Tsirkin <mst@redhat.com> | 2020-10-04 03:45:20 -0400 |
commit | ab5122510b0a453c0ac898ec9952d38e80243ee7 (patch) | |
tree | d645c482c4a211c0b1031c75d2590147462bd540 /drivers/usb/cdns3/cdns3-ti.c | |
parent | 71878fa46c7e3b40fa7b3f1b6e4ba3f92f1ac359 (diff) |
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>
Diffstat (limited to 'drivers/usb/cdns3/cdns3-ti.c')
0 files changed, 0 insertions, 0 deletions