Hi Eric,

This is a query regarding the x86_64 relocatable kernel patch in which
__pa() definition has been modified.

http://marc.theaimsgroup.com/?l=linux-kernel&m=116380877430266&w=2

Previously __pa() could handle both linearly mapped region as well
as kernel text region. Now it can only handle only linearly mapped
region and for kernel text region one is supposed to call __pa_symbol().

But arch independent code can not call __pa_symbol() as this definition
is local to i386 and x86_64 arches. So is it acceptable to change
symantics of __pa()?

If yes, then we also need to change virt_to_phys() and virt_addr_valid()
macros.

#define virt_to_page(kaddr)     pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
#define virt_addr_valid(kaddr)  pfn_valid(__pa(kaddr) >> PAGE_SHIFT)

These guys call __pa() unconditionally assuming __pa() can handle
both the address ranges. But with this change it is no more valid
and we found one problem in hibernate code where virt_to_page() is
being called for kernel text symbol "swsusp_header".

In kernel/power/swap.c
        rw_swap_page_sync(READ, swp_entry(root_swap, 0),
                       virt_to_page((unsigned long)&swsusp_header), NULL);
 
Now virt_to_page() returns wrong information.

I can think of two possible solutions.

- Restore the __pa() behaviour and live with increased cost of __pa()
  operation (due to reading of a variable from memory) because of
  relocatable kernel.

- Modify dependent operations like virt_to_page() and virt_addr_valid()
  to differentiate between two address spaces and either use __pa()
  or __pa_symbol() accordingly. Though I am not very sure up to what
  extent this will result in reduced cost of operation as virt_to_page()
  is also being used at lots of places.

Any thoughts?

Thanks
Vivek


 
_______________________________________________
fastboot mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/fastboot

Reply via email to