From xen-arm-bounces@lists.xen.org Fri Apr 04 08:23:39 2014
Return-path: <xen-arm-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2014 08:23:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-arm-bounces@lists.xen.org>)
	id 1WVzPS-0002ak-8N; Fri, 04 Apr 2014 08:23:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Shubham.Khandelwal@harman.com>)
	id 1WVzPQ-0002ac-CX; Fri, 04 Apr 2014 08:23:32 +0000
Received: from [85.158.139.211:25306] by server-11.bemta-5.messagelabs.com id
	FE/09-30804-30C6E335; Fri, 04 Apr 2014 08:23:31 +0000
X-Env-Sender: Shubham.Khandelwal@harman.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1396599810!5409705!1
X-Originating-IP: [195.245.231.148]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTk1LjI0NS4yMzEuMTQ4ID0+IDU5MTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.11.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10034 invoked from network); 4 Apr 2014 08:23:30 -0000
Received: from mail1.bemta5.messagelabs.com (HELO
	mail1.bemta5.messagelabs.com) (195.245.231.148)
	by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 4 Apr 2014 08:23:30 -0000
Received: from [85.158.139.51:2200] by server-12.bemta-5.messagelabs.com id
	35/50-03824-20C6E335; Fri, 04 Apr 2014 08:23:30 +0000
X-Env-Sender: Shubham.Khandelwal@harman.com
X-Msg-Ref: server-5.tower-180.messagelabs.com!1396599809!28516556!1
X-Originating-IP: [194.121.90.173]
X-StarScan-Received: 
X-StarScan-Version: 6.11.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22525 invoked from network); 4 Apr 2014 08:23:30 -0000
Received: from unassigned (HELO HIKAWSEX02.ad.harman.com) (194.121.90.173)
	by server-5.tower-180.messagelabs.com with AES128-SHA encrypted SMTP;
	4 Apr 2014 08:23:30 -0000
Received: from HIKAWSEX01.ad.harman.com ([fe80::f023:31d4:f809:b22e]) by
	HIKAWSEX02.ad.harman.com ([172.16.1.216]) with mapi;
	Fri, 4 Apr 2014 10:22:31 +0200
From: "Khandelwal, Shubham" <Shubham.Khandelwal@harman.com>
To: xen-devel <xen-devel@lists.xen.org>, "'xen-arm@lists.xen.org'"
	<xen-arm@lists.xen.org>, 'Stefano Stabellini'
	<stefano.stabellini@eu.citrix.com>
Date: Fri, 4 Apr 2014 10:22:30 +0200
Thread-Topic: Understanding XEN on ARM
Thread-Index: Ac9P3wOHOQnAbMaRQqmi8t0jbxjIkw==
Message-ID: <3A6586556649FF42BA3240F179473FD11454A64254@HIKAWSEX01.ad.harman.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "Datta, Souvik" <Souvik.Datta@harman.com>
Subject: [XenARM] Understanding XEN on ARM
X-BeenThere: xen-arm@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: "List for Xen ARM PV developers and users \(planned to be archived\)"
	<xen-arm.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-arm>,
	<mailto:xen-arm-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-arm@lists.xen.org>
List-Help: <mailto:xen-arm-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-arm>,
	<mailto:xen-arm-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8425987623100157359=="
Sender: xen-arm-bounces@lists.xen.org
Errors-To: xen-arm-bounces@lists.xen.org

--===============8425987623100157359==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_3A6586556649FF42BA3240F179473FD11454A64254HIKAWSEX01adh_"

--_000_3A6586556649FF42BA3240F179473FD11454A64254HIKAWSEX01adh_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello,

I am trying to understand the source code of XEN on ARM to get a deeper und=
erstanding of how XEN works and I am facing some difficulties in understand=
ing a section of the assembly code present in xen/arch/arm/arm32/head.S.

The snippet of the code is:


        /* Rebuild the boot pagetable's first-level entries. The structure
         * is described in mm.c.
         *
         * After the CPU enables paging it will add the fixmap mapping
         * to these page tables, however this may clash with the 1:1
         * mapping. So each CPU must rebuild the page tables here with
         * the 1:1 in place. */

        /* Write Xen's PT's paddr into the HTTBR */
        ldr   r4, =3Dboot_pgtable
        add   r4, r4, r10            /* r4 :=3D paddr (boot_pagetable) */
        mov   r5, #0                 /* r4:r5 is paddr (boot_pagetable) */
        mcrr  CP64(r4, r5, HTTBR)

        /* Setup boot_pgtable: */
        ldr   r1, =3Dboot_second
        add   r1, r1, r10            /* r1 :=3D paddr (boot_second) */
        mov   r3, #0x0

        /* ... map boot_second in boot_pgtable[0] */
        orr   r2, r1, #PT_UPPER(PT)  /* r2:r3 :=3D table map of boot_second=
 */
        orr   r2, r2, #PT_LOWER(PT)  /* (+ rights for linear PT) */
        strd  r2, r3, [r4, #0]       /* Map it in slot 0 */

        /* ... map of paddr(start) in boot_pgtable */
        lsrs  r1, r9, #30            /* Offset of base paddr in boot_pgtabl=
e */
        beq   1f                     /* If it is in slot 0 then map in boot=
_second
                                      * later on */
        lsl   r2, r1, #30            /* Base address for 1GB mapping */
        orr   r2, r2, #PT_UPPER(MEM) /* r2:r3 :=3D section map */
        orr   r2, r2, #PT_LOWER(MEM)
        lsl   r1, r1, #3             /* r1 :=3D Slot offset */
        strd  r2, r3, [r4, r1]       /* Mapping of paddr(start) */

1:      /* Setup boot_second: */
        ldr   r4, =3Dboot_second
        add   r4, r4, r10            /* r1 :=3D paddr (boot_second) */

        lsr   r2, r9, #20            /* Base address for 2MB mapping */
        lsl   r2, r2, #20
        orr   r2, r2, #PT_UPPER(MEM) /* r2:r3 :=3D section map */
        orr   r2, r2, #PT_LOWER(MEM)

        /* ... map of vaddr(start) in boot_second */
        ldr   r1, =3Dstart
        lsr   r1, #18                /* Slot for vaddr(start) */
        strd  r2, r3, [r4, r1]       /* Map vaddr(start) */

        /* ... map of paddr(start) in boot_second */
        lsrs  r1, r9, #30            /* Base paddr */
        bne   1f                     /* If paddr(start) is not in slot 0
                                      * then the mapping was done in
                                      * boot_pgtable above */

        mov   r1, r9, lsr #18        /* Slot for paddr(start) */
        strd  r2, r3, [r4, r1]       /* Map Xen there */
1:

        /* Defer fixmap and dtb mapping until after paging enabled, to
         * avoid them clashing with the 1:1 mapping. */

        /* boot pagetable setup complete */

        PRINT("- Turning on paging -\r\n")

        ldr   r1, =3Dpaging            /* Explicit vaddr, not RIP-relative =
*/
        mrc   CP32(r0, HSCTLR)
        orr   r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */
        dsb                          /* Flush PTE writes and finish reads *=
/
        mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
        isb                          /* Now, flush the icache */
        mov   pc, r1                 /* Get a proper vaddr into PC */
paging:

        /* Now we can install the fixmap and dtb mappings, since we
         * don't need the 1:1 map any more */
        dsb
#if defined(EARLY_PRINTK) /* Fixmap is only used by early printk */
        /* Non-boot CPUs don't need to rebuild the fixmap itself, just
             * the mapping from boot_second to xen_fixmap */
        teq   r12, #0
        bne   1f

        /* Add UART to the fixmap table */
        ldr   r1, =3Dxen_fixmap        /* r1 :=3D vaddr (xen_fixmap) */
        mov   r3, #0
        lsr   r2, r11, #12
        lsl   r2, r2, #12            /* 4K aligned paddr of UART */
        orr   r2, r2, #PT_UPPER(DEV_L3)
        orr   r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 :=3D 4K dev map including =
UART */
        strd  r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixm=
ap's slot */
1:

        /* Map fixmap into boot_second */
        ldr   r1, =3Dboot_second       /* r1 :=3D vaddr (xen_fixmap) */
        ldr   r2, =3Dxen_fixmap
        add   r2, r2, r10            /* r2 :=3D paddr (xen_fixmap) */
        orr   r2, r2, #PT_UPPER(PT)
        orr   r2, r2, #PT_LOWER(PT)  /* r2:r3 :=3D table map of xen_fixmap =
*/
        ldr   r4, =3DFIXMAP_ADDR(0)
        mov   r4, r4, lsr #18        /* r4 :=3D Slot for FIXMAP(0) */
        strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */

        /* Use a virtual address to access the UART. */
        ldr   r11, =3DEARLY_UART_VIRTUAL_ADDRESS
#endif
        /* Map the DTB in the boot misc slot */
        teq   r12, #0                /* Only on boot CPU */
        bne   1f

        ldr   r1, =3Dboot_second
        mov   r3, #0x0
        lsr   r2, r8, #21
        lsl   r2, r2, #21            /* r2: 2MB-aligned paddr of DTB */
        orr   r2, r2, #PT_UPPER(MEM)
        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 :=3D 2MB RAM incl. DTB */
        ldr   r4, =3DBOOT_FDT_VIRT_START
        mov   r4, r4, lsr #18        /* Slot for BOOT_FDT_VIRT_START */
        strd  r2, r3, [r1, r4]       /* Map it in the early fdt slot */
        dsb
1:


It will be great help if anyone can throw some light on the function of the=
 above piece of code.

Thanks & Regards

Shubham Khandelwal


--_000_3A6586556649FF42BA3240F179473FD11454A64254HIKAWSEX01adh_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>Hello,<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>I am trying to understand the source code of XEN on AR=
M to
get a deeper understanding of how XEN works and I am facing some difficulti=
es
in understanding a section of the assembly code present in xen/arch/arm/arm=
32/head.S.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>The snippet of the code is:<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Rebuild the boot pagetable's first-level entries. The structure<o:p></o:=
p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* is described in mm.c.<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
*<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* After the CPU enables paging it will add the fixmap mapping<o:p></o:p></s=
pan></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* to these page tables, however this may clash with the 1:1<o:p></o:p></spa=
n></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* mapping. So each CPU must rebuild the page tables here with<o:p></o:p></s=
pan></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* the 1:1 in place. */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Write Xen's PT's paddr into the HTTBR */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r4, =3Dboot_pgtable<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
add&nbsp;&nbsp; r4, r4,
r10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* r4=
 :=3D
paddr (boot_pagetable) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; r5,
#0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;
/* r4:r5 is paddr (boot_pagetable) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mcrr&nbsp; CP64(r4, r5, HTTBR)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Setup boot_pgtable: */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r1, =3Dboot_second<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
add&nbsp;&nbsp; r1, r1,
r10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* r1=
 :=3D
paddr (boot_second) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; r3, #0x0<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* ... map boot_second in boot_pgtable[0] */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r1, #PT_UPPER(PT)&nbsp; /* r2:r3 :=3D table map of
boot_second */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_LOWER(PT)&nbsp; /* (+ rights for linear PT) */<=
o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r4, #0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Map it i=
n
slot 0 */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* ... map of paddr(start) in boot_pgtable */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsrs&nbsp; r1, r9,
#30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Of=
fset
of base paddr in boot_pgtable */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beq&nbsp;&nbsp;
1f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* If it is in slot 0 then map in boot_second<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;
* later on */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsl&nbsp;&nbsp; r2, r1,
#30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Ba=
se
address for 1GB mapping */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_UPPER(MEM) /* r2:r3 :=3D section map */<o:p></o=
:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_LOWER(MEM)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsl&nbsp;&nbsp; r1, r1,
#3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
/*
r1 :=3D Slot offset */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r4, r1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Mapping =
of
paddr(start) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>1:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Setup boot_second: */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r4, =3Dboot_second<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
add&nbsp;&nbsp; r4, r4,
r10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* r1=
 :=3D
paddr (boot_second) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsr&nbsp;&nbsp; r2, r9,
#20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Ba=
se
address for 2MB mapping */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsl&nbsp;&nbsp; r2, r2, #20<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_UPPER(MEM) /* r2:r3 :=3D section map */<o:p></o=
:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_LOWER(MEM)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* ... map of vaddr(start) in boot_second */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r1, =3Dstart<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsr&nbsp;&nbsp; r1,
#18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;
/* Slot for vaddr(start) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r4, r1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Map
vaddr(start) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* ... map of paddr(start) in boot_second */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsrs&nbsp; r1, r9,
#30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Ba=
se
paddr */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
bne&nbsp;&nbsp;
1f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* If paddr(start) is not in slot 0<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;
* then the mapping was done in<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;
* boot_pgtable above */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; r1, r9, lsr #18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /=
*
Slot for paddr(start) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r4, r1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Map Xen
there */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>1:<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Defer fixmap and dtb mapping until after paging enabled, to<o:p></o:p></=
span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* avoid them clashing with the 1:1 mapping. */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* boot pagetable setup complete */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
PRINT(&quot;- Turning on paging -\r\n&quot;)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r1,
=3Dpaging&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 /*
Explicit vaddr, not RIP-relative */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mrc&nbsp;&nbsp; CP32(r0, HSCTLR)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */<o:p=
></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
dsb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;
/* Flush PTE writes and finish reads */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mcr&nbsp;&nbsp; CP32(r0, HSCTLR)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* now
paging is enabled */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
isb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;
/* Now, flush the icache */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; pc,
r1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;
/* Get a proper vaddr into PC */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>paging:<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Now we can install the fixmap and dtb mappings, since we<o:p></o:p></spa=
n></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* don't need the 1:1 map any more */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
dsb<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>#if
defined(EARLY_PRINTK) /* Fixmap is only used by early printk */<o:p></o:p><=
/span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Non-boot CPUs don't need to rebuild the fixmap itself, just<o:p></o:p></=
span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; &nbsp;*
the mapping from boot_second to xen_fixmap */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
teq&nbsp;&nbsp; r12, #0<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
bne&nbsp;&nbsp; 1f<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Add UART to the fixmap table */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r1, =3Dxen_fixmap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 /* r1
:=3D vaddr (xen_fixmap) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; r3, #0<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsr&nbsp;&nbsp; r2, r11, #12<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsl&nbsp;&nbsp; r2, r2,
#12&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* 4K
aligned paddr of UART */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_UPPER(DEV_L3)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 :=3D 4K dev map includin=
g UART
*/<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap'=
s
slot */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>1:<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Map fixmap into boot_second */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r1, =3Dboot_second&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* r=
1 :=3D
vaddr (xen_fixmap) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r2, =3Dxen_fixmap<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
add&nbsp;&nbsp; r2, r2,
r10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* r2=
 :=3D
paddr (xen_fixmap) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_UPPER(PT)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_LOWER(PT)&nbsp; /* r2:r3 :=3D table map of xen_=
fixmap
*/<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r4, =3DFIXMAP_ADDR(0)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov &nbsp;&nbsp;r4, r4, lsr #18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /=
* r4
:=3D Slot for FIXMAP(0) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r1, r4]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Map it i=
n
the fixmap's slot */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Use a virtual address to access the UART. */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r11, =3DEARLY_UART_VIRTUAL_ADDRESS<o:p></o:p></span></i></p=
>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>#endif<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Map the DTB in the boot misc slot */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
teq&nbsp;&nbsp; r12,
#0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;
/* Only on boot CPU */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
bne&nbsp;&nbsp; 1f<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r1, =3Dboot_second<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; r3, #0x0<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsr&nbsp;&nbsp; r2, r8, #21<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsl&nbsp;&nbsp; r2, r2,
#21&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* r2=
:
2MB-aligned paddr of DTB */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_UPPER(MEM)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_LOWER(MEM) /* r2:r3 :=3D 2MB RAM incl. DTB */<o=
:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r4, =3DBOOT_FDT_VIRT_START<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; r4, r4, lsr #18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /=
*
Slot for BOOT_FDT_VIRT_START */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r1, r4]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;/* Map it i=
n
the early fdt slot */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
dsb<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>1:<o:p></o:p></span></i></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>It will be great help if anyone can throw some light o=
n the
function of the above piece of code.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Thanks &amp; Regards<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Shubham Khandelwal<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>

--_000_3A6586556649FF42BA3240F179473FD11454A64254HIKAWSEX01adh_--


--===============8425987623100157359==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-arm mailing list
Xen-arm@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-arm

--===============8425987623100157359==--


From xen-arm-bounces@lists.xen.org Fri Apr 04 08:23:39 2014
Return-path: <xen-arm-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2014 08:23:39 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-arm-bounces@lists.xen.org>)
	id 1WVzPS-0002ak-8N; Fri, 04 Apr 2014 08:23:34 +0000
Received: from mail6.bemta5.messagelabs.com ([195.245.231.135])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Shubham.Khandelwal@harman.com>)
	id 1WVzPQ-0002ac-CX; Fri, 04 Apr 2014 08:23:32 +0000
Received: from [85.158.139.211:25306] by server-11.bemta-5.messagelabs.com id
	FE/09-30804-30C6E335; Fri, 04 Apr 2014 08:23:31 +0000
X-Env-Sender: Shubham.Khandelwal@harman.com
X-Msg-Ref: server-4.tower-206.messagelabs.com!1396599810!5409705!1
X-Originating-IP: [195.245.231.148]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTk1LjI0NS4yMzEuMTQ4ID0+IDU5MTI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.11.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 10034 invoked from network); 4 Apr 2014 08:23:30 -0000
Received: from mail1.bemta5.messagelabs.com (HELO
	mail1.bemta5.messagelabs.com) (195.245.231.148)
	by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 4 Apr 2014 08:23:30 -0000
Received: from [85.158.139.51:2200] by server-12.bemta-5.messagelabs.com id
	35/50-03824-20C6E335; Fri, 04 Apr 2014 08:23:30 +0000
X-Env-Sender: Shubham.Khandelwal@harman.com
X-Msg-Ref: server-5.tower-180.messagelabs.com!1396599809!28516556!1
X-Originating-IP: [194.121.90.173]
X-StarScan-Received: 
X-StarScan-Version: 6.11.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 22525 invoked from network); 4 Apr 2014 08:23:30 -0000
Received: from unassigned (HELO HIKAWSEX02.ad.harman.com) (194.121.90.173)
	by server-5.tower-180.messagelabs.com with AES128-SHA encrypted SMTP;
	4 Apr 2014 08:23:30 -0000
Received: from HIKAWSEX01.ad.harman.com ([fe80::f023:31d4:f809:b22e]) by
	HIKAWSEX02.ad.harman.com ([172.16.1.216]) with mapi;
	Fri, 4 Apr 2014 10:22:31 +0200
From: "Khandelwal, Shubham" <Shubham.Khandelwal@harman.com>
To: xen-devel <xen-devel@lists.xen.org>, "'xen-arm@lists.xen.org'"
	<xen-arm@lists.xen.org>, 'Stefano Stabellini'
	<stefano.stabellini@eu.citrix.com>
Date: Fri, 4 Apr 2014 10:22:30 +0200
Thread-Topic: Understanding XEN on ARM
Thread-Index: Ac9P3wOHOQnAbMaRQqmi8t0jbxjIkw==
Message-ID: <3A6586556649FF42BA3240F179473FD11454A64254@HIKAWSEX01.ad.harman.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Cc: "Datta, Souvik" <Souvik.Datta@harman.com>
Subject: [XenARM] Understanding XEN on ARM
X-BeenThere: xen-arm@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: "List for Xen ARM PV developers and users \(planned to be archived\)"
	<xen-arm.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-arm>,
	<mailto:xen-arm-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-arm@lists.xen.org>
List-Help: <mailto:xen-arm-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-arm>,
	<mailto:xen-arm-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============8425987623100157359=="
Sender: xen-arm-bounces@lists.xen.org
Errors-To: xen-arm-bounces@lists.xen.org

--===============8425987623100157359==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_3A6586556649FF42BA3240F179473FD11454A64254HIKAWSEX01adh_"

--_000_3A6586556649FF42BA3240F179473FD11454A64254HIKAWSEX01adh_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello,

I am trying to understand the source code of XEN on ARM to get a deeper und=
erstanding of how XEN works and I am facing some difficulties in understand=
ing a section of the assembly code present in xen/arch/arm/arm32/head.S.

The snippet of the code is:


        /* Rebuild the boot pagetable's first-level entries. The structure
         * is described in mm.c.
         *
         * After the CPU enables paging it will add the fixmap mapping
         * to these page tables, however this may clash with the 1:1
         * mapping. So each CPU must rebuild the page tables here with
         * the 1:1 in place. */

        /* Write Xen's PT's paddr into the HTTBR */
        ldr   r4, =3Dboot_pgtable
        add   r4, r4, r10            /* r4 :=3D paddr (boot_pagetable) */
        mov   r5, #0                 /* r4:r5 is paddr (boot_pagetable) */
        mcrr  CP64(r4, r5, HTTBR)

        /* Setup boot_pgtable: */
        ldr   r1, =3Dboot_second
        add   r1, r1, r10            /* r1 :=3D paddr (boot_second) */
        mov   r3, #0x0

        /* ... map boot_second in boot_pgtable[0] */
        orr   r2, r1, #PT_UPPER(PT)  /* r2:r3 :=3D table map of boot_second=
 */
        orr   r2, r2, #PT_LOWER(PT)  /* (+ rights for linear PT) */
        strd  r2, r3, [r4, #0]       /* Map it in slot 0 */

        /* ... map of paddr(start) in boot_pgtable */
        lsrs  r1, r9, #30            /* Offset of base paddr in boot_pgtabl=
e */
        beq   1f                     /* If it is in slot 0 then map in boot=
_second
                                      * later on */
        lsl   r2, r1, #30            /* Base address for 1GB mapping */
        orr   r2, r2, #PT_UPPER(MEM) /* r2:r3 :=3D section map */
        orr   r2, r2, #PT_LOWER(MEM)
        lsl   r1, r1, #3             /* r1 :=3D Slot offset */
        strd  r2, r3, [r4, r1]       /* Mapping of paddr(start) */

1:      /* Setup boot_second: */
        ldr   r4, =3Dboot_second
        add   r4, r4, r10            /* r1 :=3D paddr (boot_second) */

        lsr   r2, r9, #20            /* Base address for 2MB mapping */
        lsl   r2, r2, #20
        orr   r2, r2, #PT_UPPER(MEM) /* r2:r3 :=3D section map */
        orr   r2, r2, #PT_LOWER(MEM)

        /* ... map of vaddr(start) in boot_second */
        ldr   r1, =3Dstart
        lsr   r1, #18                /* Slot for vaddr(start) */
        strd  r2, r3, [r4, r1]       /* Map vaddr(start) */

        /* ... map of paddr(start) in boot_second */
        lsrs  r1, r9, #30            /* Base paddr */
        bne   1f                     /* If paddr(start) is not in slot 0
                                      * then the mapping was done in
                                      * boot_pgtable above */

        mov   r1, r9, lsr #18        /* Slot for paddr(start) */
        strd  r2, r3, [r4, r1]       /* Map Xen there */
1:

        /* Defer fixmap and dtb mapping until after paging enabled, to
         * avoid them clashing with the 1:1 mapping. */

        /* boot pagetable setup complete */

        PRINT("- Turning on paging -\r\n")

        ldr   r1, =3Dpaging            /* Explicit vaddr, not RIP-relative =
*/
        mrc   CP32(r0, HSCTLR)
        orr   r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */
        dsb                          /* Flush PTE writes and finish reads *=
/
        mcr   CP32(r0, HSCTLR)       /* now paging is enabled */
        isb                          /* Now, flush the icache */
        mov   pc, r1                 /* Get a proper vaddr into PC */
paging:

        /* Now we can install the fixmap and dtb mappings, since we
         * don't need the 1:1 map any more */
        dsb
#if defined(EARLY_PRINTK) /* Fixmap is only used by early printk */
        /* Non-boot CPUs don't need to rebuild the fixmap itself, just
             * the mapping from boot_second to xen_fixmap */
        teq   r12, #0
        bne   1f

        /* Add UART to the fixmap table */
        ldr   r1, =3Dxen_fixmap        /* r1 :=3D vaddr (xen_fixmap) */
        mov   r3, #0
        lsr   r2, r11, #12
        lsl   r2, r2, #12            /* 4K aligned paddr of UART */
        orr   r2, r2, #PT_UPPER(DEV_L3)
        orr   r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 :=3D 4K dev map including =
UART */
        strd  r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixm=
ap's slot */
1:

        /* Map fixmap into boot_second */
        ldr   r1, =3Dboot_second       /* r1 :=3D vaddr (xen_fixmap) */
        ldr   r2, =3Dxen_fixmap
        add   r2, r2, r10            /* r2 :=3D paddr (xen_fixmap) */
        orr   r2, r2, #PT_UPPER(PT)
        orr   r2, r2, #PT_LOWER(PT)  /* r2:r3 :=3D table map of xen_fixmap =
*/
        ldr   r4, =3DFIXMAP_ADDR(0)
        mov   r4, r4, lsr #18        /* r4 :=3D Slot for FIXMAP(0) */
        strd  r2, r3, [r1, r4]       /* Map it in the fixmap's slot */

        /* Use a virtual address to access the UART. */
        ldr   r11, =3DEARLY_UART_VIRTUAL_ADDRESS
#endif
        /* Map the DTB in the boot misc slot */
        teq   r12, #0                /* Only on boot CPU */
        bne   1f

        ldr   r1, =3Dboot_second
        mov   r3, #0x0
        lsr   r2, r8, #21
        lsl   r2, r2, #21            /* r2: 2MB-aligned paddr of DTB */
        orr   r2, r2, #PT_UPPER(MEM)
        orr   r2, r2, #PT_LOWER(MEM) /* r2:r3 :=3D 2MB RAM incl. DTB */
        ldr   r4, =3DBOOT_FDT_VIRT_START
        mov   r4, r4, lsr #18        /* Slot for BOOT_FDT_VIRT_START */
        strd  r2, r3, [r1, r4]       /* Map it in the early fdt slot */
        dsb
1:


It will be great help if anyone can throw some light on the function of the=
 above piece of code.

Thanks & Regards

Shubham Khandelwal


--_000_3A6586556649FF42BA3240F179473FD11454A64254HIKAWSEX01adh_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>Hello,<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>I am trying to understand the source code of XEN on AR=
M to
get a deeper understanding of how XEN works and I am facing some difficulti=
es
in understanding a section of the assembly code present in xen/arch/arm/arm=
32/head.S.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>The snippet of the code is:<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Rebuild the boot pagetable's first-level entries. The structure<o:p></o:=
p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* is described in mm.c.<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
*<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* After the CPU enables paging it will add the fixmap mapping<o:p></o:p></s=
pan></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* to these page tables, however this may clash with the 1:1<o:p></o:p></spa=
n></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* mapping. So each CPU must rebuild the page tables here with<o:p></o:p></s=
pan></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* the 1:1 in place. */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Write Xen's PT's paddr into the HTTBR */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r4, =3Dboot_pgtable<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
add&nbsp;&nbsp; r4, r4,
r10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* r4=
 :=3D
paddr (boot_pagetable) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; r5,
#0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;
/* r4:r5 is paddr (boot_pagetable) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mcrr&nbsp; CP64(r4, r5, HTTBR)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Setup boot_pgtable: */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r1, =3Dboot_second<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
add&nbsp;&nbsp; r1, r1,
r10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* r1=
 :=3D
paddr (boot_second) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; r3, #0x0<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* ... map boot_second in boot_pgtable[0] */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r1, #PT_UPPER(PT)&nbsp; /* r2:r3 :=3D table map of
boot_second */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_LOWER(PT)&nbsp; /* (+ rights for linear PT) */<=
o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r4, #0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Map it i=
n
slot 0 */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* ... map of paddr(start) in boot_pgtable */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsrs&nbsp; r1, r9,
#30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Of=
fset
of base paddr in boot_pgtable */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;beq&nbsp;&nbsp;
1f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* If it is in slot 0 then map in boot_second<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;
* later on */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsl&nbsp;&nbsp; r2, r1,
#30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Ba=
se
address for 1GB mapping */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_UPPER(MEM) /* r2:r3 :=3D section map */<o:p></o=
:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_LOWER(MEM)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsl&nbsp;&nbsp; r1, r1,
#3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; =
/*
r1 :=3D Slot offset */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r4, r1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Mapping =
of
paddr(start) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>1:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Setup boot_second: */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r4, =3Dboot_second<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
add&nbsp;&nbsp; r4, r4,
r10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* r1=
 :=3D
paddr (boot_second) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsr&nbsp;&nbsp; r2, r9,
#20&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Ba=
se
address for 2MB mapping */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsl&nbsp;&nbsp; r2, r2, #20<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_UPPER(MEM) /* r2:r3 :=3D section map */<o:p></o=
:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_LOWER(MEM)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* ... map of vaddr(start) in boot_second */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r1, =3Dstart<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsr&nbsp;&nbsp; r1,
#18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;
/* Slot for vaddr(start) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r4, r1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Map
vaddr(start) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* ... map of paddr(start) in boot_second */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsrs&nbsp; r1, r9,
#30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Ba=
se
paddr */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
bne&nbsp;&nbsp;
1f&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* If paddr(start) is not in slot 0<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;
* then the mapping was done in<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs=
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;
* boot_pgtable above */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; r1, r9, lsr #18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /=
*
Slot for paddr(start) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r4, r1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Map Xen
there */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>1:<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Defer fixmap and dtb mapping until after paging enabled, to<o:p></o:p></=
span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* avoid them clashing with the 1:1 mapping. */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* boot pagetable setup complete */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
PRINT(&quot;- Turning on paging -\r\n&quot;)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r1,
=3Dpaging&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 /*
Explicit vaddr, not RIP-relative */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mrc&nbsp;&nbsp; CP32(r0, HSCTLR)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r0, r0, #(SCTLR_M|SCTLR_C) /* Enable MMU and D-cache */<o:p=
></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
dsb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;
/* Flush PTE writes and finish reads */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mcr&nbsp;&nbsp; CP32(r0, HSCTLR)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* now
paging is enabled */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
isb&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb=
sp;
/* Now, flush the icache */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; pc,
r1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;&nbsp;
/* Get a proper vaddr into PC */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>paging:<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Now we can install the fixmap and dtb mappings, since we<o:p></o:p></spa=
n></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
* don't need the 1:1 map any more */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
dsb<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>#if
defined(EARLY_PRINTK) /* Fixmap is only used by early printk */<o:p></o:p><=
/span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Non-boot CPUs don't need to rebuild the fixmap itself, just<o:p></o:p></=
span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp; &nbsp;*
the mapping from boot_second to xen_fixmap */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
teq&nbsp;&nbsp; r12, #0<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
bne&nbsp;&nbsp; 1f<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Add UART to the fixmap table */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r1, =3Dxen_fixmap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;=
 /* r1
:=3D vaddr (xen_fixmap) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; r3, #0<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsr&nbsp;&nbsp; r2, r11, #12<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsl&nbsp;&nbsp; r2, r2,
#12&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* 4K
aligned paddr of UART */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_UPPER(DEV_L3)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_LOWER(DEV_L3) /* r2:r3 :=3D 4K dev map includin=
g UART
*/<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r1, #(FIXMAP_CONSOLE*8)] /* Map it in the first fixmap'=
s
slot */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>1:<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Map fixmap into boot_second */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r1, =3Dboot_second&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* r=
1 :=3D
vaddr (xen_fixmap) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r2, =3Dxen_fixmap<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
add&nbsp;&nbsp; r2, r2,
r10&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* r2=
 :=3D
paddr (xen_fixmap) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_UPPER(PT)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_LOWER(PT)&nbsp; /* r2:r3 :=3D table map of xen_=
fixmap
*/<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r4, =3DFIXMAP_ADDR(0)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov &nbsp;&nbsp;r4, r4, lsr #18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /=
* r4
:=3D Slot for FIXMAP(0) */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r1, r4]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* Map it i=
n
the fixmap's slot */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Use a virtual address to access the UART. */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r11, =3DEARLY_UART_VIRTUAL_ADDRESS<o:p></o:p></span></i></p=
>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>#endif<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
/* Map the DTB in the boot misc slot */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
teq&nbsp;&nbsp; r12,
#0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&=
nbsp;&nbsp;&nbsp;
/* Only on boot CPU */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
bne&nbsp;&nbsp; 1f<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'><o:p>&nbsp;</o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r1, =3Dboot_second<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; r3, #0x0<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsr&nbsp;&nbsp; r2, r8, #21<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
lsl&nbsp;&nbsp; r2, r2,
#21&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /* r2=
:
2MB-aligned paddr of DTB */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_UPPER(MEM)<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
orr&nbsp;&nbsp; r2, r2, #PT_LOWER(MEM) /* r2:r3 :=3D 2MB RAM incl. DTB */<o=
:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
ldr&nbsp;&nbsp; r4, =3DBOOT_FDT_VIRT_START<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
mov&nbsp;&nbsp; r4, r4, lsr #18&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; /=
*
Slot for BOOT_FDT_VIRT_START */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
strd&nbsp; r2, r3, [r1, r4]&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;/* Map it i=
n
the early fdt slot */<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
dsb<o:p></o:p></span></i></p>

<p class=3DMsoNormal><i><span style=3D'font-size:12.0pt;font-family:"Times =
New Roman","serif"'>1:<o:p></o:p></span></i></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>It will be great help if anyone can throw some light o=
n the
function of the above piece of code.<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Thanks &amp; Regards<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Shubham Khandelwal<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>

--_000_3A6586556649FF42BA3240F179473FD11454A64254HIKAWSEX01adh_--


--===============8425987623100157359==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-arm mailing list
Xen-arm@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-arm

--===============8425987623100157359==--


From xen-arm-bounces@lists.xen.org Fri Apr 04 08:50:16 2014
Return-path: <xen-arm-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2014 08:50:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-arm-bounces@lists.xen.org>)
	id 1WVzpF-00052X-VA; Fri, 04 Apr 2014 08:50:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1WVzpE-00052O-1P; Fri, 04 Apr 2014 08:50:12 +0000
Received: from [193.109.254.147:49210] by server-10.bemta-14.messagelabs.com
	id 0F/2A-04546-3427E335; Fri, 04 Apr 2014 08:50:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1396601408!6267183!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.11.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23890 invoked from network); 4 Apr 2014 08:50:10 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	4 Apr 2014 08:50:10 -0000
X-IronPort-AV: E=Sophos;i="4.97,793,1389744000"; d="scan'208";a="117940882"
Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net)
	([10.9.154.239])
	by FTLPIPO01.CITRIX.COM with ESMTP; 04 Apr 2014 08:50:08 +0000
Received: from [10.80.2.80] (10.80.2.80) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Fri, 4 Apr 2014
	04:50:07 -0400
Message-ID: <1396601406.4211.161.camel@kazak.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Khandelwal, Shubham" <Shubham.Khandelwal@harman.com>
Date: Fri, 4 Apr 2014 09:50:06 +0100
In-Reply-To: <3A6586556649FF42BA3240F179473FD11454A64254@HIKAWSEX01.ad.harman.com>
References: <3A6586556649FF42BA3240F179473FD11454A64254@HIKAWSEX01.ad.harman.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.8.5-2+b3 
MIME-Version: 1.0
X-Originating-IP: [10.80.2.80]
X-DLP: MIA2
Cc: "Datta, Souvik" <Souvik.Datta@harman.com>,
	"'xen-arm@lists.xen.org'" <xen-arm@lists.xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [XenARM] Understanding XEN on ARM
X-BeenThere: xen-arm@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: "List for Xen ARM PV developers and users \(planned to be archived\)"
	<xen-arm.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-arm>,
	<mailto:xen-arm-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-arm@lists.xen.org>
List-Help: <mailto:xen-arm-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-arm>,
	<mailto:xen-arm-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-arm-bounces@lists.xen.org
Errors-To: xen-arm-bounces@lists.xen.org

On Fri, 2014-04-04 at 10:22 +0200, Khandelwal, Shubham wrote:
> It will be great help if anyone can throw some light on the function
> of the above piece of code.

This code is constructing an initial set of page tables for us to use
when we enable paging, the structure of those PTs is, as the comment
says, described in mm.c.

Ian.


_______________________________________________
Xen-arm mailing list
Xen-arm@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-arm

From xen-arm-bounces@lists.xen.org Fri Apr 04 08:50:16 2014
Return-path: <xen-arm-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Fri, 04 Apr 2014 08:50:16 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-arm-bounces@lists.xen.org>)
	id 1WVzpF-00052X-VA; Fri, 04 Apr 2014 08:50:13 +0000
Received: from mail6.bemta14.messagelabs.com ([193.109.254.103])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Ian.Campbell@citrix.com>)
	id 1WVzpE-00052O-1P; Fri, 04 Apr 2014 08:50:12 +0000
Received: from [193.109.254.147:49210] by server-10.bemta-14.messagelabs.com
	id 0F/2A-04546-3427E335; Fri, 04 Apr 2014 08:50:11 +0000
X-Env-Sender: Ian.Campbell@citrix.com
X-Msg-Ref: server-4.tower-27.messagelabs.com!1396601408!6267183!1
X-Originating-IP: [66.165.176.89]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogNjYuMTY1LjE3Ni44OSA9PiAyMDMwMDc=\n
X-StarScan-Received: 
X-StarScan-Version: 6.11.1; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 23890 invoked from network); 4 Apr 2014 08:50:10 -0000
Received: from smtp.citrix.com (HELO SMTP.CITRIX.COM) (66.165.176.89)
	by server-4.tower-27.messagelabs.com with RC4-SHA encrypted SMTP;
	4 Apr 2014 08:50:10 -0000
X-IronPort-AV: E=Sophos;i="4.97,793,1389744000"; d="scan'208";a="117940882"
Received: from accessns.citrite.net (HELO FTLPEX01CL02.citrite.net)
	([10.9.154.239])
	by FTLPIPO01.CITRIX.COM with ESMTP; 04 Apr 2014 08:50:08 +0000
Received: from [10.80.2.80] (10.80.2.80) by FTLPEX01CL02.citrite.net
	(10.13.107.79) with Microsoft SMTP Server id 14.2.342.4; Fri, 4 Apr 2014
	04:50:07 -0400
Message-ID: <1396601406.4211.161.camel@kazak.uk.xensource.com>
From: Ian Campbell <Ian.Campbell@citrix.com>
To: "Khandelwal, Shubham" <Shubham.Khandelwal@harman.com>
Date: Fri, 4 Apr 2014 09:50:06 +0100
In-Reply-To: <3A6586556649FF42BA3240F179473FD11454A64254@HIKAWSEX01.ad.harman.com>
References: <3A6586556649FF42BA3240F179473FD11454A64254@HIKAWSEX01.ad.harman.com>
Organization: Citrix Systems, Inc.
X-Mailer: Evolution 3.8.5-2+b3 
MIME-Version: 1.0
X-Originating-IP: [10.80.2.80]
X-DLP: MIA2
Cc: "Datta, Souvik" <Souvik.Datta@harman.com>,
	"'xen-arm@lists.xen.org'" <xen-arm@lists.xen.org>,
	xen-devel <xen-devel@lists.xen.org>
Subject: Re: [XenARM] Understanding XEN on ARM
X-BeenThere: xen-arm@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: "List for Xen ARM PV developers and users \(planned to be archived\)"
	<xen-arm.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-arm>,
	<mailto:xen-arm-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-arm@lists.xen.org>
List-Help: <mailto:xen-arm-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-arm>,
	<mailto:xen-arm-request@lists.xen.org?subject=subscribe>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Sender: xen-arm-bounces@lists.xen.org
Errors-To: xen-arm-bounces@lists.xen.org

On Fri, 2014-04-04 at 10:22 +0200, Khandelwal, Shubham wrote:
> It will be great help if anyone can throw some light on the function
> of the above piece of code.

This code is constructing an initial set of page tables for us to use
when we enable paging, the structure of those PTs is, as the comment
says, described in mm.c.

Ian.


_______________________________________________
Xen-arm mailing list
Xen-arm@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-arm

From xen-arm-bounces@lists.xen.org Tue Apr 29 11:35:29 2014
Return-path: <xen-arm-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2014 11:35:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-arm-bounces@lists.xen.org>)
	id 1Wf6Jn-0004Uw-Be; Tue, 29 Apr 2014 11:35:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Shubham.Khandelwal@harman.com>)
	id 1Wf6Jm-0004Uj-Gb; Tue, 29 Apr 2014 11:35:22 +0000
Received: from [85.158.137.68:37399] by server-13.bemta-3.messagelabs.com id
	E2/5D-18692-97E8F535; Tue, 29 Apr 2014 11:35:21 +0000
X-Env-Sender: Shubham.Khandelwal@harman.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1398771320!770303!1
X-Originating-IP: [195.245.231.151]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTk1LjI0NS4yMzEuMTUxID0+IDU3NzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24039 invoked from network); 29 Apr 2014 11:35:20 -0000
Received: from mail1.bemta5.messagelabs.com (HELO
	mail1.bemta5.messagelabs.com) (195.245.231.151)
	by server-3.tower-31.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Apr 2014 11:35:20 -0000
Received: from [85.158.139.19:56071] by server-15.bemta-5.messagelabs.com id
	CC/E0-11079-87E8F535; Tue, 29 Apr 2014 11:35:20 +0000
X-Env-Sender: Shubham.Khandelwal@harman.com
X-Msg-Ref: server-16.tower-178.messagelabs.com!1398771319!21683892!2
X-Originating-IP: [194.121.90.173]
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8414 invoked from network); 29 Apr 2014 11:35:19 -0000
Received: from unassigned (HELO HIKAWSEX03.ad.harman.com) (194.121.90.173)
	by server-16.tower-178.messagelabs.com with AES128-SHA encrypted SMTP;
	29 Apr 2014 11:35:19 -0000
Received: from HIKAWSEX01.ad.harman.com ([fe80::f023:31d4:f809:b22e]) by
	HIKAWSEX03.ad.harman.com ([172.16.1.217]) with mapi; Tue, 29 Apr 2014
	13:35:00 +0200
From: "Khandelwal, Shubham" <Shubham.Khandelwal@harman.com>
To: "'xen-arm@lists.xen.org'" <xen-arm@lists.xen.org>, xen-devel
	<xen-devel@lists.xen.org>, "xen-devel@lists.xensource.com"
	<xen-devel@lists.xensource.com>
Date: Tue, 29 Apr 2014 13:35:00 +0200
Thread-Topic: Device pass through on XEN on ARM
Thread-Index: Ac9jmCdfJo4F86aBQhuvI309+xxWGw==
Message-ID: <3A6586556649FF42BA3240F179473FD11454A64270@HIKAWSEX01.ad.harman.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: [XenARM] Device pass through on XEN on ARM
X-BeenThere: xen-arm@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: "List for Xen ARM PV developers and users \(planned to be archived\)"
	<xen-arm.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-arm>,
	<mailto:xen-arm-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-arm@lists.xen.org>
List-Help: <mailto:xen-arm-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-arm>,
	<mailto:xen-arm-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5869781872578339416=="
Sender: xen-arm-bounces@lists.xen.org
Errors-To: xen-arm-bounces@lists.xen.org

--===============5869781872578339416==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_3A6586556649FF42BA3240F179473FD11454A64270HIKAWSEX01adh_"

--_000_3A6586556649FF42BA3240F179473FD11454A64270HIKAWSEX01adh_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello,

I would like to understand how is pass through achieved on XEN on ARM for d=
evices which do not have a PCI bus controller, like for example embedded de=
vices. Any pointers in this direction will be appreciated.

Thanks & Regards

Shubham Khandelwal


--_000_3A6586556649FF42BA3240F179473FD11454A64270HIKAWSEX01adh_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>Hello,<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>I would like to understand how is pass through achieve=
d on
XEN on ARM for devices which do not have a PCI bus controller, like for exa=
mple
embedded devices. Any pointers in this direction will be appreciated.<o:p><=
/o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Thanks &amp; Regards<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Shubham Khandelwal<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>

--_000_3A6586556649FF42BA3240F179473FD11454A64270HIKAWSEX01adh_--


--===============5869781872578339416==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-arm mailing list
Xen-arm@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-arm

--===============5869781872578339416==--


From xen-arm-bounces@lists.xen.org Tue Apr 29 11:35:29 2014
Return-path: <xen-arm-bounces@lists.xen.org>
Envelope-to: archives@lists.xen.org
Delivery-date: Tue, 29 Apr 2014 11:35:29 +0000
Received: from localhost ([127.0.0.1] helo=lists.xen.org)
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <xen-arm-bounces@lists.xen.org>)
	id 1Wf6Jn-0004Uw-Be; Tue, 29 Apr 2014 11:35:23 +0000
Received: from mail6.bemta3.messagelabs.com ([195.245.230.39])
	by lists.xen.org with esmtp (Exim 4.72)
	(envelope-from <Shubham.Khandelwal@harman.com>)
	id 1Wf6Jm-0004Uj-Gb; Tue, 29 Apr 2014 11:35:22 +0000
Received: from [85.158.137.68:37399] by server-13.bemta-3.messagelabs.com id
	E2/5D-18692-97E8F535; Tue, 29 Apr 2014 11:35:21 +0000
X-Env-Sender: Shubham.Khandelwal@harman.com
X-Msg-Ref: server-3.tower-31.messagelabs.com!1398771320!770303!1
X-Originating-IP: [195.245.231.151]
X-SpamReason: No, hits=0.0 required=7.0 tests=sa_preprocessor: 
	VHJ1c3RlZCBJUDogMTk1LjI0NS4yMzEuMTUxID0+IDU3NzI=\n
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 24039 invoked from network); 29 Apr 2014 11:35:20 -0000
Received: from mail1.bemta5.messagelabs.com (HELO
	mail1.bemta5.messagelabs.com) (195.245.231.151)
	by server-3.tower-31.messagelabs.com with DHE-RSA-AES256-SHA encrypted
	SMTP; 29 Apr 2014 11:35:20 -0000
Received: from [85.158.139.19:56071] by server-15.bemta-5.messagelabs.com id
	CC/E0-11079-87E8F535; Tue, 29 Apr 2014 11:35:20 +0000
X-Env-Sender: Shubham.Khandelwal@harman.com
X-Msg-Ref: server-16.tower-178.messagelabs.com!1398771319!21683892!2
X-Originating-IP: [194.121.90.173]
X-StarScan-Received: 
X-StarScan-Version: 6.11.3; banners=-,-,-
X-VirusChecked: Checked
Received: (qmail 8414 invoked from network); 29 Apr 2014 11:35:19 -0000
Received: from unassigned (HELO HIKAWSEX03.ad.harman.com) (194.121.90.173)
	by server-16.tower-178.messagelabs.com with AES128-SHA encrypted SMTP;
	29 Apr 2014 11:35:19 -0000
Received: from HIKAWSEX01.ad.harman.com ([fe80::f023:31d4:f809:b22e]) by
	HIKAWSEX03.ad.harman.com ([172.16.1.217]) with mapi; Tue, 29 Apr 2014
	13:35:00 +0200
From: "Khandelwal, Shubham" <Shubham.Khandelwal@harman.com>
To: "'xen-arm@lists.xen.org'" <xen-arm@lists.xen.org>, xen-devel
	<xen-devel@lists.xen.org>, "xen-devel@lists.xensource.com"
	<xen-devel@lists.xensource.com>
Date: Tue, 29 Apr 2014 13:35:00 +0200
Thread-Topic: Device pass through on XEN on ARM
Thread-Index: Ac9jmCdfJo4F86aBQhuvI309+xxWGw==
Message-ID: <3A6586556649FF42BA3240F179473FD11454A64270@HIKAWSEX01.ad.harman.com>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach: 
X-MS-TNEF-Correlator: 
acceptlanguage: en-US
MIME-Version: 1.0
Subject: [XenARM] Device pass through on XEN on ARM
X-BeenThere: xen-arm@lists.xen.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: "List for Xen ARM PV developers and users \(planned to be archived\)"
	<xen-arm.lists.xen.org>
List-Unsubscribe: <http://lists.xen.org/cgi-bin/mailman/options/xen-arm>,
	<mailto:xen-arm-request@lists.xen.org?subject=unsubscribe>
List-Post: <mailto:xen-arm@lists.xen.org>
List-Help: <mailto:xen-arm-request@lists.xen.org?subject=help>
List-Subscribe: <http://lists.xen.org/cgi-bin/mailman/listinfo/xen-arm>,
	<mailto:xen-arm-request@lists.xen.org?subject=subscribe>
Content-Type: multipart/mixed; boundary="===============5869781872578339416=="
Sender: xen-arm-bounces@lists.xen.org
Errors-To: xen-arm-bounces@lists.xen.org

--===============5869781872578339416==
Content-Language: en-US
Content-Type: multipart/alternative;
	boundary="_000_3A6586556649FF42BA3240F179473FD11454A64270HIKAWSEX01adh_"

--_000_3A6586556649FF42BA3240F179473FD11454A64270HIKAWSEX01adh_
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

Hello,

I would like to understand how is pass through achieved on XEN on ARM for d=
evices which do not have a PCI bus controller, like for example embedded de=
vices. Any pointers in this direction will be appreciated.

Thanks & Regards

Shubham Khandelwal


--_000_3A6586556649FF42BA3240F179473FD11454A64270HIKAWSEX01adh_
Content-Type: text/html; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable

<html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-micr=
osoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" =
xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http:=
//www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii">
<meta name=3DGenerator content=3D"Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0in;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri","sans-serif";}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:blue;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:purple;
	text-decoration:underline;}
span.EmailStyle17
	{mso-style-type:personal-compose;
	font-family:"Calibri","sans-serif";
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-size:10.0pt;}
@page Section1
	{size:8.5in 11.0in;
	margin:1.0in 1.0in 1.0in 1.0in;}
div.Section1
	{page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext=3D"edit">
  <o:idmap v:ext=3D"edit" data=3D"1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body lang=3DEN-US link=3Dblue vlink=3Dpurple>

<div class=3DSection1>

<p class=3DMsoNormal>Hello,<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>I would like to understand how is pass through achieve=
d on
XEN on ARM for devices which do not have a PCI bus controller, like for exa=
mple
embedded devices. Any pointers in this direction will be appreciated.<o:p><=
/o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Thanks &amp; Regards<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

<p class=3DMsoNormal>Shubham Khandelwal<o:p></o:p></p>

<p class=3DMsoNormal><o:p>&nbsp;</o:p></p>

</div>

</body>

</html>

--_000_3A6586556649FF42BA3240F179473FD11454A64270HIKAWSEX01adh_--


--===============5869781872578339416==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Xen-arm mailing list
Xen-arm@lists.xen.org
http://lists.xen.org/cgi-bin/mailman/listinfo/xen-arm

--===============5869781872578339416==--


