From owner-freebsd-arm@FreeBSD.ORG Fri Jan 28 14:36:23 2011 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6B114106564A for ; Fri, 28 Jan 2011 14:36:23 +0000 (UTC) (envelope-from marktinguely@gmail.com) Received: from mail-iy0-f182.google.com (mail-iy0-f182.google.com [209.85.210.182]) by mx1.freebsd.org (Postfix) with ESMTP id 2D3748FC28 for ; Fri, 28 Jan 2011 14:36:23 +0000 (UTC) Received: by iyb26 with SMTP id 26so2677076iyb.13 for ; Fri, 28 Jan 2011 06:36:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=jid4SKXxUpxP9sdLIYB4SOpWMmegKpFlVUXxkj1XhhE=; b=MnFkmHuGgSy8kRw2L/xlVvSxUPsRA9FayoaUgky8HP53WuQ3OoafuZC5kEmBk5LBNn Or/NUFz75aCYCJ1taqOZlKqrVZhrp4bGX2mDs49rbj2/hyFjFrlWUC4fduj2Eg3vNMdm yk64+T4LIWa94bLReXgXzFf+yOLZqkXy4qFZ0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; b=SpeVXAC/lqlECEsXPJzHrx7PaJUNY9s/JH/z1KZg5g26JCqVzAgfGz9VV+g68zYMHo uNYYQmFjebhHp6VaUEGv7ghNOD7MFp5AZiymFmkQjVruSAupeNW7SrRNADr8n0hYXaco EYJKW4D4U/RXHuRO5CQE17K2dbP+I1/QZpkiE= Received: by 10.42.172.67 with SMTP id m3mr3985894icz.95.1296225382138; Fri, 28 Jan 2011 06:36:22 -0800 (PST) Received: from [192.168.1.104] (c-24-245-26-12.hsd1.mn.comcast.net [24.245.26.12]) by mx.google.com with ESMTPS id u5sm13397192ics.18.2011.01.28.06.36.19 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 28 Jan 2011 06:36:20 -0800 (PST) Message-ID: <4D42D45D.5080200@gmail.com> Date: Fri, 28 Jan 2011 08:36:13 -0600 From: Mark Tinguely User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7 MIME-Version: 1.0 To: Devesh Rai References: <0DB595A2CB707F458400BE9663B6A7225E42E36569@SC-VEXCH2.marvell.com> In-Reply-To: <0DB595A2CB707F458400BE9663B6A7225E42E36569@SC-VEXCH2.marvell.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Cc: "freebsd-arm@freebsd.org" Subject: Re: Changing virtual adress space layout X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting FreeBSD to the StrongARM Processor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Jan 2011 14:36:23 -0000 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.