<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
Am 31.01.24 um 11:20 schrieb Zhang, Julia:<br>
<blockquote type="cite" cite="mid:IA1PR12MB653270F7FD75C1B4DF8B90E8F27C2@IA1PR12MB6532.namprd12.prod.outlook.com">
<pre class="moz-quote-pre" wrap="">On 2024/1/30 22:23, Christian König wrote:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Am 30.01.24 um 12:16 schrieb Daniel Vetter:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">On Tue, Jan 30, 2024 at 12:10:31PM +0100, Daniel Vetter wrote:
</pre>
<blockquote type="cite">[SNIP]<span style="white-space: pre-wrap">
</span>
<pre class="moz-quote-pre" wrap=""></pre>
</blockquote>
</blockquote>
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">Hi Sima, Christian,
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Yeah, that is really just speculative. All importers need to set the peer2peer flag just in case.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
I see, I will modify this.
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
What happens under the hood is that IOMMU redirects the "VRAM" memory access to whatever address the DMA-buf on the host is pointing to (system, VRAM, doorbell, IOMMU, whatever).
I'm also not 100% sure if all the cache snooping is done correctly in all cases, but for now it seems to work.
</pre>
<blockquote type="cite">
<blockquote type="cite">
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">Frankly the more I look at the original patch that added vram export
support the more this just looks like a "pls revert, this is just too
broken".
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">The commit I mean is this one: ea5ea3d8a117 ("drm/virtio: support mapping
exported vram"). The commit message definitely needs to cite that one, and
also needs a cc: stable because not rejecting invalid imports is a pretty
big deal.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Yeah, I've pointed out that commit in an internal discussion as well. I was just not aware that it's that severely broken.
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
Yeah we have mentioned this patch before, but I don't totally understand why this is too broken. Without exporting vram objects, dGPU prime feature would not be realized.
Would you mind to explain more about it. Thanks!</pre>
</blockquote>
<br>
One reason is that using sg tables without struct pages is actually
a hack we came up with because we couldn't hope to clean up the sg
table structure any time soon to not include struct page pointers.<br>
<br>
Another reason is that using this with devices which don't expect a
DMA address pointing into a virtual PCI BAR. So doing this without
checking the peer2peer flag can most likely cause quite a bit of
trouble.<br>
<br>
Regards,<br>
Christian.<br>
<br>
<blockquote type="cite" cite="mid:IA1PR12MB653270F7FD75C1B4DF8B90E8F27C2@IA1PR12MB6532.namprd12.prod.outlook.com">
<pre class="moz-quote-pre" wrap="">
Best regards,
Julia
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Regards,
Christian.
</pre>
</blockquote>
</blockquote>
</body>
</html>