lkml.org 
[lkml]   [2012]   [Oct]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 08/10] x86, xen, mm: fix mapping_pagetable_reserve logic
On 10/09/2012 12:39 PM, Yinghai Lu wrote:
> */
> struct x86_init_mapping {
> - void (*pagetable_reserve)(u64 start, u64 end);
> + void (*make_range_readwrite)(u64 start, u64 end);
> };
>

Here you go from one misleading name to another. Another classic case
of "why hooks suck."

make_range_readwrite is particularly toxic, though, because it makes it
sound like it something along the lines of set_memory_rw(), which it
most distinctly is not.

Furthermore, the naming makes me really puzzled why it is there at all.
It makes me suspect, but because the patchset is so messy, it is hard
for me to immediately prove, that you're still missing something important.

However, for example:

> unsigned long __initdata pgt_buf_start;
> unsigned long __meminitdata pgt_buf_end;
> unsigned long __meminitdata pgt_buf_top;
> +unsigned long __initdata early_pgt_buf_start;
> +unsigned long __meminitdata early_pgt_buf_end;
> +unsigned long __meminitdata early_pgt_buf_top;
>
> bool __init is_pfn_in_early_pgt_buf(unsigned long pfn)
> {
> - return pfn >= pgt_buf_start && pfn < pgt_buf_top;
> + return (pfn >= early_pgt_buf_start && pfn < early_pgt_buf_top) ||
> + (pfn >= pgt_buf_start && pfn < pgt_buf_top);
> }

Magic variables augmented with more magic variables. Why? This also
seems to assume that we still do all the kernel page tables in one
chunk, which is exactly what we don't want to do.

-hpa



\
 
 \ /
  Last update: 2012-10-09 09:21    [W:0.153 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site