* __virt_addr_valid vs virtual percpu areas
@ 2009-03-04 22:57 Jeremy Fitzhardinge
2009-03-04 23:19 ` Jiri Slaby
0 siblings, 1 reply; 3+ messages in thread
From: Jeremy Fitzhardinge @ 2009-03-04 22:57 UTC (permalink / raw)
To: Tejun Heo, Ingo Molnar
Cc: the arch/x86 maintainers, Linux Kernel Mailing List,
Vegard Nossum, Jiri Slaby
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? 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()).
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)?
Thanks,
J
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: __virt_addr_valid vs virtual percpu areas
2009-03-04 22:57 __virt_addr_valid vs virtual percpu areas Jeremy Fitzhardinge
@ 2009-03-04 23:19 ` Jiri Slaby
2009-03-04 23:48 ` Jeremy Fitzhardinge
0 siblings, 1 reply; 3+ messages in thread
From: Jiri Slaby @ 2009-03-04 23:19 UTC (permalink / raw)
To: Jeremy Fitzhardinge
Cc: Tejun Heo, Ingo Molnar, the arch/x86 maintainers,
Linux Kernel Mailing List, Vegard Nossum
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: __virt_addr_valid vs virtual percpu areas
2009-03-04 23:19 ` Jiri Slaby
@ 2009-03-04 23:48 ` Jeremy Fitzhardinge
0 siblings, 0 replies; 3+ messages in thread
From: Jeremy Fitzhardinge @ 2009-03-04 23:48 UTC (permalink / raw)
To: Jiri Slaby
Cc: Tejun Heo, Ingo Molnar, the arch/x86 maintainers,
Linux Kernel Mailing List, Vegard Nossum
Jiri Slaby wrote:
> 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.
Yeah, I pieced that together. I'm just testing a patch with a specific
__vmalloc_start_set flag to test.
>> 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?
percpu data gets mapped into the vmalloc region now (when using 4k page
mappings, at least).
>> 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.
OK.
J
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-03-04 23:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-04 22:57 __virt_addr_valid vs virtual percpu areas Jeremy Fitzhardinge
2009-03-04 23:19 ` Jiri Slaby
2009-03-04 23:48 ` Jeremy Fitzhardinge
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox