Date: Mon, 31 Jan 2011 17:01:59 -0800 From: Devesh Rai <deveshkr@marvell.com> To: Mark Tinguely <marktinguely@gmail.com> Cc: "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org> Subject: RE: Changing virtual adress space layout Message-ID: <0DB595A2CB707F458400BE9663B6A7225E42E92B10@SC-VEXCH2.marvell.com> In-Reply-To: <4D42D45D.5080200@gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Hi Mark, After going through "Hardware Page Table Translation" section of manual, it= looks like section based mapping is more beneficial. Because it requires j= ust one "First Level" fetch by MMU for virtual to physical address translat= ion. What you told me in your previous response is making sense to me. I can now= play around with code a bit. Thanks a lot for you help and time. Thanks & Regards Devesh =20 -----Original Message----- From: Mark Tinguely [mailto:marktinguely@gmail.com]=20 Sent: Friday, January 28, 2011 8:06 PM To: Devesh Rai Cc: freebsd-arm@freebsd.org Subject: Re: Changing virtual adress space layout On 1/28/2011 7:35 AM, Devesh Rai wrote: > Hi Mark, > > Thank you very much for your detail response. Trick of not changing KERNV= IRTADDR worked. > I was able to map 1GB of RAM into kva from KERNBASE(0x8000_0000) to OLD_K= ERNBASE(0xC000_0000) using pmap_map_chunk api. > I was able to write some data into mapped space and print it back. > > But some doubt I still have > > 1) What is L1 and L2 page table in FreeBSD? Is there document which expla= ins these vm concepts for arm? > 2) How do I verify that this mapping indeed happened? > > Thanks& Regards > Devesh Good news. The ARM(r) Architecture Reference Manual is available for download on the=20 website www.arm.com. There is a document that covers ARMv4-ARMv6 and a=20 document for ARMv7. The L1 maps 1MB of contiguous memory or has a pointer to a 1KB l2 page=20 table entry that maps 256 4KB pages. Sounds like you are mapping a 1MB contiuous area of memory that is on a=20 1 MB boundary, but If you were not then, you first need to allocate 1KB=20 for the l2 page table and install it into the kernel page table using=20 the pmap_link_l2pt() routine. The pmap_map_chunk() routine can then be=20 used to install the l1/l2 mapping. You may want to think about the appropriate caching of this memory. You can look at the l1 (and l2 if used) page tables to verify that the=20 KVA is mapped to the proper PA. I suppose you could remap the PA to=20 another KVA to verify values too, but you have to understand caching=20 principles to do this correctly. --Mark.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?0DB595A2CB707F458400BE9663B6A7225E42E92B10>