lkml.org 
[lkml]   [2009]   [Oct]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC Patch] use MTRR for write combining if PAT is not available
>>> Thomas Schlichter <thomas.schlichter@web.de> 13.10.09 23:29 >>>
>Jan Beulich wrote:
>> >>> Thomas Schlichter <thomas.schlichter@web.de> 12.10.09 20:32 >>>
>> >+ if (!pat_enabled) {
>> >+ void __iomem *ret = ioremap_nocache(phys_addr, size);
>> >+ if (ret)
>> >+ mtrr_add(phys_addr, size, MTRR_TYPE_WRCOMB, false);
>>
>> This won't work if phys_addr or size aren't page aligned, or if size isn't
>> a power of two.
>
>No, at least the comments in mtrr_add and mtrr_check state that it is just
>required that phys_addr and size are multiple of PAGE_SIZE. And I'm not sure
>if it is always safe to round these up/down to the next PAGE boundary. If it
>is not, maybe it is better to fail...

That function isn't the limiting factor, generic_validate_add_page() is
what you need to look at (plus the spec on how the MTRR ranges are
calculated by the CPU from the base/mask register pairs).

Jan



\
 
 \ /
  Last update: 2009-10-14 10:19    [W:0.099 / U:0.084 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site