All of lore.kernel.org
 help / color / mirror / Atom feed
* identity mapped paging
@ 2012-04-11 21:22 Vaibhav Jain
  2012-06-19  9:23 ` subin gangadharan
  2012-06-19 15:54 ` Dave Hylands
  0 siblings, 2 replies; 3+ messages in thread
From: Vaibhav Jain @ 2012-04-11 21:22 UTC (permalink / raw)
  To: kernelnewbies

I am not clear about the use of identity mapped paging while paging is
being enabled by the operating system. Also I don't understand at what
point are the
identity mappings no longer useful.According to this article
http://geezer.osdevbrasil.net/osd/mem/index.htm#identity - "The page table
entries used to identity-map kernel memory can be deleted once paging and
virtual addresses are enabled." Can somebody please explain?

Thanks
Vaibhav Jain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20120411/ac8fccf1/attachment.html 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* identity mapped paging
  2012-04-11 21:22 identity mapped paging Vaibhav Jain
@ 2012-06-19  9:23 ` subin gangadharan
  2012-06-19 15:54 ` Dave Hylands
  1 sibling, 0 replies; 3+ messages in thread
From: subin gangadharan @ 2012-06-19  9:23 UTC (permalink / raw)
  To: kernelnewbies

Hi Vaibhav,

> identity mappings no longer useful.According to this article
> http://geezer.osdevbrasil.net/osd/mem/index.htm#identity?- "The page table
> entries used to identity-map kernel memory can be deleted once paging and
> virtual addresses are enabled." Can somebody please explain?


I don't have a good idea on this. But my guess is, these entries has
to there to enable MMU. Because after enabling it you are still in the
same address space. Basically kernel needs an x to x
translation(identity mapping) before kernel do the jump to the virtual
space (0xc000 0000), after that  those entries are not needed any
more.

Will wait for our kernel experts comments.

>
> Thanks
> Vaibhav Jain
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



-- 
With Regards
Subin Gangadharan

I am not afraid and I am also not afraid of being afraid.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* identity mapped paging
  2012-04-11 21:22 identity mapped paging Vaibhav Jain
  2012-06-19  9:23 ` subin gangadharan
@ 2012-06-19 15:54 ` Dave Hylands
  1 sibling, 0 replies; 3+ messages in thread
From: Dave Hylands @ 2012-06-19 15:54 UTC (permalink / raw)
  To: kernelnewbies

Hi Vaibhav,

On Wed, Apr 11, 2012 at 2:22 PM, Vaibhav Jain <vjoss197@gmail.com> wrote:
> I am not clear about the use of identity mapped paging while paging is being
> enabled by the operating system. Also I don't understand at what point are
> the
> identity mappings no longer useful.According to this article
> http://geezer.osdevbrasil.net/osd/mem/index.htm#identity?- "The page table
> entries used to identity-map kernel memory can be deleted once paging and
> virtual addresses are enabled." Can somebody please explain?

The identity mapping are used when the MMU is first enabled. I'm most
familiar with the ARM, so the rest of my comments are ARM specific.

When the kernel first gets control, the MMU is off, so virtual
addresses == physical addresses.

The kernel sets up a small identity mapping (virtual == physical) as
well as a the kernel direct mapping. This happens in assembler code
before any C code in the kernel runs.
http://lxr.linux.no/linux+v3.4.3/arch/arm/kernel/head.S#L203

The identity mapping is needed for the code that turns on the MMU. The
identity mapping is only needed for a few instructions. If you look at
http://lxr.linux.no/linux+v3.4.3/arch/arm/kernel/head.S#L451

The identity mapping is really only needed while lines 454 thru 459
execute. The mov pc, r13 instruction changes the PC to be in the
0xCxxxxxxx range (assuming a normal 3G user/ 1G kernel split is being
used).

Later on, in paging_init (which is written in C), that identity
mapping is removed, and the MMU is setup properly for the rest of the
kernel.

-- 
Dave Hylands
Shuswap, BC, Canada
http://www.davehylands.com

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-19 15:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-11 21:22 identity mapped paging Vaibhav Jain
2012-06-19  9:23 ` subin gangadharan
2012-06-19 15:54 ` Dave Hylands

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.