<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<div dir="auto">
<div>Sorry if the style is messed up, replying from my phone.<br>
<div class="gmail_extra"><br>
<div class="gmail_quote">Am 15.08.2019 20:27 schrieb Christoph Hellwig <hch@lst.de>:<br type="attribution">
<blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><font size="2"><span style="font-size:11pt">
<div>On Thu, Aug 15, 2019 at 06:21:00PM +0000, Koenig, Christian wrote:<br>
> >   (2) Add support for DMA_ATTR_NO_KERNEL_MAPPING to this new API instead<br>
> >       of dma_alloc_attrs.  The initial difference with that flag is just<br>
> >       that we allow highmem, but in the future we could also unmap this<br>
> >       memory from the kernel linear mapping entirely on architectures<br>
> >       where we can easily do that.<br>
> <br>
> Mhm, why would we want to do this?<br>
<br>
To avoid the CPU misspeculating into this memory.  For example NVMe SSDs<br>
have a feature called host memory buffer that is a lot like your stolen<br>
main ram for the GPU case.  We currently hand the SSD a<br>
DMA_ATTR_NO_KERNEL_MAPPING allocation if it requests such a buffer.  If<br>
possible we'd really like to make sure no speculative execution bug<br>
(or intentional attacker with a kernel exploit for that matter) can easily<br>
access that memory.<br>
</div>
</span></font></div>
</blockquote>
</div>
</div>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Well, for the graphics case I absolutely need to keep the linear kernel mapping. Because for certain use cases the memory is accessed by the kernel all the time as well.<br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">Why should accessing uncached memory be more of a security problem than accessing cached?</div>
<div dir="auto"><br>
</div>
<div dir="auto">Regards,</div>
<div dir="auto">Christian</div>
<div dir="auto">
<div class="gmail_extra">
<div class="gmail_quote">
<blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><font size="2"><span style="font-size:11pt">
<div></div>
</span></font></div>
</blockquote>
</div>
<br>
</div>
</div>
</div>
</body>
</html>