Dave Anderson | 19 Jul 2012 16:05
Picon
Favicon

Question about ARM module address range


Hi guys,

While looking at the ARM per-cpu address range issue, I ran into
something re: the ARM module address range values that has me
confused.

In arm_init(), POST_VM, you've got:

              machdep->machspec->modules_end = machdep->kvbase - 1;

But it never gets used, because here in arm_is_module_addr() the
local variable "module_end" is used instead -- although it is set 
to the same value:

  static int
  arm_is_module_addr(ulong vaddr)
  {
          ulong modules_start;
          ulong modules_end = machdep->kvbase - 1;

          if (!MODULES_VADDR) {
                  /*
                   * In case we are still initializing, and vm_init() has not been
                   * called, we use defaults here which is 16MB below kernel start
                   * address.
                   */
                  modules_start = machdep->kvbase - 16 * 1024 * 1024;
          } else {
                  modules_start = MODULES_VADDR;
(Continue reading)

Karlsson, Jan | 25 Jul 2012 08:03
Favicon

Re: Question about ARM module address range

Hi Dave

I have taken a short look at modules_vaddr and module_end and I have both seen relevant data:

crash> help -m
      modules_vaddr: bf000000
        modules_end: bfffffff

and data similar to what you see. What I also have seen is that when modules are loaded then modules_vaddr and
modules_end seems correct and when no modules have been loaded then strange values are presented. I have
looked at too few examples to be certain that this is "always" true.

I assume (not checked in source code) that no vmalloc area is allocated for modules if no modules are loaded.
Then the function first_vmalloc_address() will return data which is stored in modules_vaddr but has
nothing to do with this.

So I think that the question is what values should modules_vaddr and modules_end have if no modules are
loaded. Does it matter, except that it might be confusing for a user? Looking at arm.c where modules_vaddr
and modules_end are used, I think the code will behaves correctly (by luck?!), also in the case of no modules.

Jan

Jan Karlsson
Senior Software Engineer
MIB
 
Sony Mobile Communications
Tel: +46703062174
sonymobile.com
 
(Continue reading)


Gmane