lkml.org 
[lkml]   [2009]   [Mar]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: __virt_addr_valid vs virtual percpu areas
On 4.3.2009 23:57, Jeremy Fitzhardinge wrote:
> On i386, __virt_addr_valid() has the test:
>
> if (system_state != SYSTEM_BOOTING && is_vmalloc_addr((void *) x))
> return false;
>
>
> Why is the vmalloc area a valid virtual address while the system is
> booting?

It's not (in the meaning of virt_* functions), but while booting we
don't have variables used in VMALLOC_START and VMALLOC_END ready for use
on i386.

Maybe we can introduce more clever method/state which would say: hey,
vmalloc framework is up and running. And use instead (system_state !=
SYSTEM_BOOTING) hack.

> This is biting me because I need to translate percpu addresses
> to pfns, but I only bother doing the full pagetable walk if
> virt_addr_valid() is false (otherwise I just use __pa()).

Do you need to bother also with vmalloc space?

> Removing this test doesn't seem to harm anything at first glance. Is
> this OK to do in general (and can we quietly set fire to system_state
> while we're about it)?

I wouldn't do that, since vmalloc addr is not virt addr, again in the
meaning of virt_* functions. And the function wouldn't do the right
thing, at least in the RUNNING state anymore.


\
 
 \ /
  Last update: 2009-03-05 00:21    [W:0.068 / U:0.060 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site