All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Eugenio Pérez" <eperezma@redhat.com>
To: qemu-devel@nongnu.org
Cc: Parav Pandit <parav@mellanox.com>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Jason Wang <jasowang@redhat.com>,
	virtualization@lists.linux-foundation.org,
	Stefan Hajnoczi <stefanha@redhat.com>,
	Eli Cohen <eli@mellanox.com>,
	Stefano Garzarella <sgarzare@redhat.com>
Subject: [PATCH v4 0/3] vdpa: Check iova range on memory regions ops
Date: Thu, 14 Oct 2021 16:12:33 +0200	[thread overview]
Message-ID: <20211014141236.923287-1-eperezma@redhat.com> (raw)

At this moment vdpa will not send memory regions bigger than 1<<63.
However, actual iova range could be way more restrictive than that.

Since we can obtain the range through vdpa ioctl call, just save it
from the beginning of the operation and check against it.

Changes from v3:
* Change default value from UINT64_MAX >> 1 to UINT64_MAX, making it
  aligned with the kernel.

Changes from v2:
* Fallback to a default value in case kernel does not support
  VHOST_VDPA_GET_IOVA_RANGE syscall.

Changes from v1:
* Use of int128_gt instead of plain uint64_t < comparison on memory
  range end.
* Document vhost_vdpa_section_end's return value so it's clear that
  it returns "one past end".

Eugenio Pérez (3):
  vdpa: Skip protected ram IOMMU mappings
  vdpa: Add vhost_vdpa_section_end
  vdpa: Check for iova range at mappings changes

 include/hw/virtio/vhost-vdpa.h |  2 +
 hw/virtio/vhost-vdpa.c         | 81 +++++++++++++++++++++++++---------
 hw/virtio/trace-events         |  1 +
 3 files changed, 63 insertions(+), 21 deletions(-)

-- 
2.27.0




             reply	other threads:[~2021-10-14 14:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-14 14:12 Eugenio Pérez [this message]
2021-10-14 14:12 ` [PATCH v4 1/3] vdpa: Skip protected ram IOMMU mappings Eugenio Pérez
2021-10-18  9:15   ` Stefano Garzarella
2021-10-18  9:15     ` Stefano Garzarella
2021-10-14 14:12 ` [PATCH v4 2/3] vdpa: Add vhost_vdpa_section_end Eugenio Pérez
2021-10-18  9:15   ` Stefano Garzarella
2021-10-18  9:15     ` Stefano Garzarella
2021-10-14 14:12 ` [PATCH v4 3/3] vdpa: Check for iova range at mappings changes Eugenio Pérez
2021-10-15  8:12   ` Jason Wang
2021-10-15  8:12     ` Jason Wang
2021-10-18  9:22   ` Stefano Garzarella
2021-10-18  9:22     ` Stefano Garzarella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211014141236.923287-1-eperezma@redhat.com \
    --to=eperezma@redhat.com \
    --cc=eli@mellanox.com \
    --cc=jasowang@redhat.com \
    --cc=mst@redhat.com \
    --cc=parav@mellanox.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sgarzare@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=virtualization@lists.linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.