From: "Kasireddy, Vivek" <vivek.kasireddy@intel.com>
To: "Christian König" <christian.koenig@amd.com>,
"Gerd Hoffmann" <kraxel@redhat.com>
Cc: "Kim, Dongwon" <dongwon.kim@intel.com>,
"daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
Daniel Vetter <daniel@ffwll.ch>,
"Vetter, Daniel" <daniel.vetter@intel.com>,
"sumit.semwal@linaro.org" <sumit.semwal@linaro.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: RE: [RFC v3 2/3] virtio: Introduce Vdmabuf driver
Date: Fri, 12 Feb 2021 08:36:44 +0000 [thread overview]
Message-ID: <fd23d4d08ea84ca3b8a7610a8fb866d5@intel.com> (raw)
In-Reply-To: <8ac10b1d-3d64-4e39-42e6-6c65b61f0794@amd.com>
Hi Christian,
>
> Hi Vivek,
>
> > [Kasireddy, Vivek] What if I do mmap() on the fd followed by mlock()
> > or mmap() followed by get_user_pages()? If it still fails, would
> > ioremapping the device memory and poking at the backing storage be an
> > option? Or, if I bind the passthrough'd GPU device to vfio-pci and tap
> > into the memory region associated with the device memory, can it be made to work?
>
> get_user_pages() is not allowed on mmaped DMA-bufs in the first place.
>
> Daniel is currently adding code to make sure that this is never ever used.
>
> > And, I noticed that for PFNs that do not have valid struct page
> > associated with it, KVM does a memremap() to access/map them. Is this an option?
>
> No, even for system memory which has a valid struct page touching it when it is part of a
> DMA-buf is illegal since the reference count and mapping fields in struct page might be
> used for something different.
>
> Keep in mind that struct page is a heavily overloaded structure for different use cases. You
> can't just use it for a different use case than what the owner of the page has intended it.
[Kasireddy, Vivek] What is your recommended/acceptable way for doing what I am trying to
do?
Thanks,
Vivek
>
> Regards,
> Christian.
>
> >
> >
> > Thanks,
> > Vivek
> >> take care,
> >> Gerd
_______________________________________________
Virtualization mailing list
Virtualization@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/virtualization
WARNING: multiple messages have this Message-ID (diff)
From: "Kasireddy, Vivek" <vivek.kasireddy@intel.com>
To: "Christian König" <christian.koenig@amd.com>,
"Gerd Hoffmann" <kraxel@redhat.com>
Cc: "Kim, Dongwon" <dongwon.kim@intel.com>,
"daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"Vetter, Daniel" <daniel.vetter@intel.com>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: RE: [RFC v3 2/3] virtio: Introduce Vdmabuf driver
Date: Fri, 12 Feb 2021 08:36:44 +0000 [thread overview]
Message-ID: <fd23d4d08ea84ca3b8a7610a8fb866d5@intel.com> (raw)
In-Reply-To: <8ac10b1d-3d64-4e39-42e6-6c65b61f0794@amd.com>
Hi Christian,
>
> Hi Vivek,
>
> > [Kasireddy, Vivek] What if I do mmap() on the fd followed by mlock()
> > or mmap() followed by get_user_pages()? If it still fails, would
> > ioremapping the device memory and poking at the backing storage be an
> > option? Or, if I bind the passthrough'd GPU device to vfio-pci and tap
> > into the memory region associated with the device memory, can it be made to work?
>
> get_user_pages() is not allowed on mmaped DMA-bufs in the first place.
>
> Daniel is currently adding code to make sure that this is never ever used.
>
> > And, I noticed that for PFNs that do not have valid struct page
> > associated with it, KVM does a memremap() to access/map them. Is this an option?
>
> No, even for system memory which has a valid struct page touching it when it is part of a
> DMA-buf is illegal since the reference count and mapping fields in struct page might be
> used for something different.
>
> Keep in mind that struct page is a heavily overloaded structure for different use cases. You
> can't just use it for a different use case than what the owner of the page has intended it.
[Kasireddy, Vivek] What is your recommended/acceptable way for doing what I am trying to
do?
Thanks,
Vivek
>
> Regards,
> Christian.
>
> >
> >
> > Thanks,
> > Vivek
> >> take care,
> >> Gerd
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
WARNING: multiple messages have this Message-ID (diff)
From: "Kasireddy, Vivek" <vivek.kasireddy@intel.com>
To: "Christian König" <christian.koenig@amd.com>,
"Gerd Hoffmann" <kraxel@redhat.com>
Cc: Daniel Vetter <daniel@ffwll.ch>,
"virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"Vetter, Daniel" <daniel.vetter@intel.com>,
"daniel.vetter@ffwll.ch" <daniel.vetter@ffwll.ch>,
"Kim, Dongwon" <dongwon.kim@intel.com>,
"sumit.semwal@linaro.org" <sumit.semwal@linaro.org>,
"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>
Subject: RE: [RFC v3 2/3] virtio: Introduce Vdmabuf driver
Date: Fri, 12 Feb 2021 08:36:44 +0000 [thread overview]
Message-ID: <fd23d4d08ea84ca3b8a7610a8fb866d5@intel.com> (raw)
In-Reply-To: <8ac10b1d-3d64-4e39-42e6-6c65b61f0794@amd.com>
Hi Christian,
>
> Hi Vivek,
>
> > [Kasireddy, Vivek] What if I do mmap() on the fd followed by mlock()
> > or mmap() followed by get_user_pages()? If it still fails, would
> > ioremapping the device memory and poking at the backing storage be an
> > option? Or, if I bind the passthrough'd GPU device to vfio-pci and tap
> > into the memory region associated with the device memory, can it be made to work?
>
> get_user_pages() is not allowed on mmaped DMA-bufs in the first place.
>
> Daniel is currently adding code to make sure that this is never ever used.
>
> > And, I noticed that for PFNs that do not have valid struct page
> > associated with it, KVM does a memremap() to access/map them. Is this an option?
>
> No, even for system memory which has a valid struct page touching it when it is part of a
> DMA-buf is illegal since the reference count and mapping fields in struct page might be
> used for something different.
>
> Keep in mind that struct page is a heavily overloaded structure for different use cases. You
> can't just use it for a different use case than what the owner of the page has intended it.
[Kasireddy, Vivek] What is your recommended/acceptable way for doing what I am trying to
do?
Thanks,
Vivek
>
> Regards,
> Christian.
>
> >
> >
> > Thanks,
> > Vivek
> >> take care,
> >> Gerd
next prev parent reply other threads:[~2021-02-12 8:36 UTC|newest]
Thread overview: 57+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-03 7:35 [RFC v3 0/3] Introduce Virtio based Dmabuf driver Vivek Kasireddy
2021-02-03 7:35 ` Vivek Kasireddy
2021-02-03 7:35 ` Vivek Kasireddy
2021-02-03 7:35 ` [RFC v3 1/3] kvm: Add a notifier for create and destroy VM events Vivek Kasireddy
2021-02-03 7:35 ` Vivek Kasireddy
2021-02-03 7:35 ` Vivek Kasireddy
2021-02-03 7:35 ` [RFC v3 2/3] virtio: Introduce Vdmabuf driver Vivek Kasireddy
2021-02-03 7:35 ` Vivek Kasireddy
2021-02-03 7:35 ` Vivek Kasireddy
2021-02-03 9:15 ` kernel test robot
2021-02-05 16:03 ` Daniel Vetter
2021-02-05 16:03 ` Daniel Vetter
2021-02-05 16:03 ` Daniel Vetter
2021-02-08 7:57 ` Gerd Hoffmann
2021-02-08 7:57 ` Gerd Hoffmann
2021-02-08 7:57 ` Gerd Hoffmann
2021-02-08 9:38 ` Daniel Vetter
2021-02-08 9:38 ` Daniel Vetter
2021-02-08 9:38 ` Daniel Vetter
2021-02-09 0:25 ` Kasireddy, Vivek
2021-02-09 0:25 ` Kasireddy, Vivek
2021-02-09 0:25 ` Kasireddy, Vivek
2021-02-09 8:44 ` Gerd Hoffmann
2021-02-09 8:44 ` Gerd Hoffmann
2021-02-10 4:47 ` Kasireddy, Vivek
2021-02-10 4:47 ` Kasireddy, Vivek
2021-02-10 4:47 ` Kasireddy, Vivek
2021-02-10 8:05 ` Christian König
2021-02-10 8:05 ` Christian König
2021-02-10 8:05 ` Christian König
2021-02-12 8:36 ` Kasireddy, Vivek [this message]
2021-02-12 8:36 ` Kasireddy, Vivek
2021-02-12 8:36 ` Kasireddy, Vivek
2021-02-12 8:47 ` Christian König
2021-02-12 8:47 ` Christian König
2021-02-12 8:47 ` Christian König
2021-02-12 10:14 ` Gerd Hoffmann
2021-02-12 10:14 ` Gerd Hoffmann
2021-02-12 10:14 ` Gerd Hoffmann
2021-02-10 9:16 ` Gerd Hoffmann
2021-02-10 9:16 ` Gerd Hoffmann
2021-02-10 9:16 ` Gerd Hoffmann
2021-02-12 8:15 ` Kasireddy, Vivek
2021-02-12 8:15 ` Kasireddy, Vivek
2021-02-12 8:15 ` Kasireddy, Vivek
2021-02-12 11:01 ` Gerd Hoffmann
2021-02-12 11:01 ` Gerd Hoffmann
2021-02-12 11:01 ` Gerd Hoffmann
2021-02-22 8:52 ` Kasireddy, Vivek
2021-02-22 8:52 ` Kasireddy, Vivek
2021-02-22 8:52 ` Kasireddy, Vivek
2021-03-15 2:27 ` Zhang, Tina
2021-03-15 2:27 ` Zhang, Tina
2021-03-15 2:27 ` Zhang, Tina
2021-02-03 7:35 ` [RFC v3 3/3] vhost: Add Vdmabuf backend Vivek Kasireddy
2021-02-03 7:35 ` Vivek Kasireddy
2021-02-03 7:35 ` Vivek Kasireddy
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=fd23d4d08ea84ca3b8a7610a8fb866d5@intel.com \
--to=vivek.kasireddy@intel.com \
--cc=christian.koenig@amd.com \
--cc=daniel.vetter@ffwll.ch \
--cc=daniel.vetter@intel.com \
--cc=daniel@ffwll.ch \
--cc=dongwon.kim@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=kraxel@redhat.com \
--cc=linux-media@vger.kernel.org \
--cc=sumit.semwal@linaro.org \
--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.