Date: Fri, 28 Jan 2011 08:36:13 -0600 From: Mark Tinguely <marktinguely@gmail.com> To: Devesh Rai <deveshkr@marvell.com> Cc: "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org> Subject: Re: Changing virtual adress space layout Message-ID: <4D42D45D.5080200@gmail.com> In-Reply-To: <0DB595A2CB707F458400BE9663B6A7225E42E36569@SC-VEXCH2.marvell.com> References: <0DB595A2CB707F458400BE9663B6A7225E42E36569@SC-VEXCH2.marvell.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 1/28/2011 7:35 AM, Devesh Rai wrote: > Hi Mark, > > Thank you very much for your detail response. Trick of not changing KERNVIRTADDR worked. > I was able to map 1GB of RAM into kva from KERNBASE(0x8000_0000) to OLD_KERNBASE(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 explains these vm concepts for arm? > 2) How do I verify that this mapping indeed happened? > > Thanks& Regards > Devesh Good news. The ARMŽ Architecture Reference Manual is available for download on the website www.arm.com. There is a document that covers ARMv4-ARMv6 and a document for ARMv7. The L1 maps 1MB of contiguous memory or has a pointer to a 1KB l2 page table entry that maps 256 4KB pages. Sounds like you are mapping a 1MB contiuous area of memory that is on a 1 MB boundary, but If you were not then, you first need to allocate 1KB for the l2 page table and install it into the kernel page table using the pmap_link_l2pt() routine. The pmap_map_chunk() routine can then be 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 KVA is mapped to the proper PA. I suppose you could remap the PA to another KVA to verify values too, but you have to understand caching principles to do this correctly. --Mark.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4D42D45D.5080200>