lkml.org 
[lkml]   [2008]   [Sep]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRE: [PATCH 1/4] add is_buffer_dma_capable helper function
From
On Tue, 9 Sep 2008 09:17:05 -0700
"Luck, Tony" <tony.luck@intel.com> wrote:

> +static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size)
> +{
> + return addr + size <= mask;
> +}
>
> Do we care about wrap-around (e.g. addr=0xffffffffffffffff size=2)?

We could do something like:

return addr < mask && addr + size <= mask;


But such wrap-around can happen only with a buggy IOMMU
implementation. A driver will does DMA from 0xffffffffffffffff to
0x1. Even if this function does the right thing in such case, we will
be dead?


\
 
 \ /
  Last update: 2008-09-09 18:53    [W:0.107 / U:0.740 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site