lkml.org 
[lkml]   [2009]   [Feb]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] i386 pci: Handle mmaping 64bit bars.
"H. Peter Anvin" <hpa@zytor.com> writes:

> Eric W. Biederman wrote:
>> While reading through pci_mmap_page_range I realized that if don't
>> properly handle 64bit bars in the 32bit kernel.
>>
>> Without the added cast the shift will be done in 32bit despite being
>> assigned to a 64bit variable and if we are mmaping an address above
>> 4G things will do the wrong thing.
>
> Hm... this really should be resource_size_t, no?
>
>> - u64 addr = vma->vm_pgoff << PAGE_SHIFT;
>> + u64 addr = ((u64)vma->vm_pgoff) << PAGE_SHIFT;

It is a parameter to the reserve_memtype and free_memtype functions,
which take a u64 so the type looks ok.

If I was going to quibble I would argue that those functions should
take a pfn instead of a u64...

Eric


\
 
 \ /
  Last update: 2009-02-14 08:11    [W:0.038 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site