From: Ian Campbell Subject: Re: [PATCH v3 5/8] xen/arm: preserve DTB mappings Date: Wed, 19 Dec 2012 12:36:40 +0000 Message-ID: <1355920600.14620.371.camel@zakaz.uk.xensource.com> References: <1355856402-26614-5-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: <1355856402-26614-5-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 > @@ -295,12 +296,23 @@ void __init setup_pagetables(unsigned long boot_phys_offset, paddr_t xen_paddr) > write_pte(xen_second + second_linear_offset(XEN_VIRT_START), pte); > /* TLBFLUSH and ISB would be needed here, but wait until we set WXN */ > > + /* preserve the DTB mapping a little while longer */ Not so much "preserve" as "put back" after this function clobbered it. I'm not convinced by this effectively open coding of a "stack" of mappings in the BOOT_MISC_VIRT_START slot. IMHO this slot should only be used for ephemeral mappings within individual functions or over short spans of code -- otherwise there is plenty of potential for clashes which lead to hard to decipher bugs. Can we not map the boot fdt as and when we need it instead of trying to preserve a mapping? Or maybe FIXMAP_BOOT_FDT? > + pte = mfn_to_xen_entry(((unsigned long) _sdtb + boot_phys_offset) >> PAGE_SHIFT); > + write_pte(xen_second + second_linear_offset(BOOT_MISC_VIRT_START), pte); This use of _sdtb is only valid if CONFIG_DTB_FILE. You need to propagate atag_paddr as passed to start_xen. Ian.