[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <m1hc2xa416.fsf@fess.ebiederm.org>
Date: Fri, 13 Feb 2009 23:09:09 -0800
From: ebiederm@...ssion.com (Eric W. Biederman)
To: "H. Peter Anvin" <hpa@...or.com>
Cc: Ingo Molnar <mingo@...e.hu>, Thomas Gleixner <tglx@...utronix.de>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] i386 pci: Handle mmaping 64bit bars.
"H. Peter Anvin" <hpa@...or.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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists