From: Ian Campbell Subject: Re: [PATCH 2/7] xen/arm: setup the fixmap in head.S Date: Thu, 25 Oct 2012 10:33:26 +0100 Message-ID: <1351157606.18035.133.camel@zakaz.uk.xensource.com> References: <1351091027-20740-2-git-send-email-stefano.stabellini@eu.citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1351091027-20740-2-git-send-email-stefano.stabellini@eu.citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Stefano Stabellini Cc: "xen-devel@lists.xensource.com" , "Tim (Xen.org)" List-Id: xen-devel@lists.xenproject.org On Wed, 2012-10-24 at 16:03 +0100, Stefano Stabellini wrote: > @@ -183,6 +184,16 @@ skip_bss: > teq r12, #0 > bne pt_ready > > + /* console fixmap */ > + ldr r1, =xen_fixmap > + add r1, r1, r10 /* r1 := paddr (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 := 4K dev map including UART */ > + strd r2, r3, [r1, #0] /* Map it in the first fixmap's slot */ > + > /* Build the baseline idle pagetable's first-level entries */ > ldr r1, =xen_second > add r1, r1, r10 /* r1 := paddr (xen_second) */ [...] > @@ -205,12 +216,13 @@ skip_bss: > ldr r4, =start > lsr r4, #18 /* Slot for vaddr(start) */ > strd r2, r3, [r1, r4] /* Map Xen there too */ > + > #ifdef EARLY_UART_ADDRESS > - ldr r3, =(1<<(54-32)) /* NS for device mapping */ > - lsr r2, r11, #21 > - lsl r2, r2, #21 /* 2MB-aligned paddr of UART */ > - orr r2, r2, #PT_UPPER(DEV) > - orr r2, r2, #PT_LOWER(DEV) /* r2:r3 := 2MB dev map including UART */ > + /* xen_fixmap pagetable */ > + ldr r2, =xen_fixmap > + add r2, r2, r10 > + orr r2, r2, #PT_UPPER(PT) > + orr r2, r2, #PT_LOWER(PT) /* r2:r3 := paddr (xen_fixmap) */ We should setup the fixmap infrastructure even if !EARLY_UART_ADDRESS, unless we set it up again later? As it stands it looks like you setup the generic fixmap mapping iff EARLY_UART_ADDRESS (second hunk above) but setup the UART mapping within that unconditionally (first hunk) which is exactly backwards, isn't it ? Ian.