All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 0/3] vhost: fix device IOTLB feature lifecycle
@ 2026-08-14 14:45 Jia Jia
  2026-08-14 14:45 ` [PATCH v5 1/3] vhost: add helpers for device IOTLB lifecycle Jia Jia
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Jia Jia @ 2026-08-14 14:45 UTC (permalink / raw)
  To: stefanha, sgarzare, mst, jasowangio
  Cc: eperezma, kvm, virtualization, netdev, linux-kernel

Both vhost-vsock and vhost-net can leave the device IOTLB attached when
userspace clears VIRTIO_F_ACCESS_PLATFORM. They also replace an existing
IOTLB with a new empty table when a later feature update keeps
ACCESS_PLATFORM enabled, for example when updating logging.

The stale IOTLB can keep old translations active after a memory table
change, while replacing an existing table discards valid translations and
causes avoidable IOTLB misses.

Patch 1 makes device IOTLB initialization idempotent and adds a common
teardown helper. The helper detaches the table from every virtqueue,
resets metadata caches, clears queued IOTLB miss messages, and frees the
old table after the virtqueue handoff. It is a no-op when no device IOTLB
is installed.

Patches 2 and 3 use the common helper when vhost-vsock and vhost-net clear
ACCESS_PLATFORM. The backend-specific code continues to update
acked_features in its own virtqueue loop.

Changes since v4:
- move the existing-IOTLB check into vhost_init_device_iotlb()
- remove the vhost-vsock-specific keep-IOTLB patch
- add the corresponding ACCESS_PLATFORM teardown to vhost-net
- make vhost_clear_device_iotlb() handle an absent device IOTLB

Jia Jia (3):
  vhost: add helpers for device IOTLB lifecycle
  vhost/vsock: discard IOTLB when ACCESS_PLATFORM is cleared
  vhost/net: discard IOTLB when ACCESS_PLATFORM is cleared

 drivers/vhost/net.c   |  4 ++++
 drivers/vhost/vhost.c | 28 ++++++++++++++++++++++++++++
 drivers/vhost/vhost.h |  1 +
 drivers/vhost/vsock.c |  4 ++++
 4 files changed, 36 insertions(+), 3 deletions(-)

-- 
2.34.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-08-14 14:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-14 14:45 [PATCH v5 0/3] vhost: fix device IOTLB feature lifecycle Jia Jia
2026-08-14 14:45 ` [PATCH v5 1/3] vhost: add helpers for device IOTLB lifecycle Jia Jia
2026-08-14 14:45 ` [PATCH v5 2/3] vhost/vsock: discard IOTLB when ACCESS_PLATFORM is cleared Jia Jia
2026-08-14 14:45 ` [PATCH v5 3/3] vhost/net: " Jia Jia

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.