From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Stabellini Subject: [PATCH v6 07/10] xen/arm: move setup_mm right after setup_pagetables Date: Tue, 15 Jan 2013 19:05:53 +0000 Message-ID: <1358276756-6189-7-git-send-email-stefano.stabellini@eu.citrix.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xensource.com Cc: tim@xen.org, Ian.Campbell@citrix.com, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org At the moment we destroy the DTB mappings we have in setup_pagetables and we restore them only in setup_mm. Move setup_mm right after setup_pagetables. This ensures we have a valid DTB mapping while running the subsequent initialization code. Changes in v5: - reword commit message; - turn printk in setup_mm into an early_printk. Signed-off-by: Stefano Stabellini --- xen/arch/arm/setup.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index b5cb912..dc94adc 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -135,7 +135,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) xenheap_pages = min(1ul << (30 - PAGE_SHIFT), heap_pages); domheap_pages = heap_pages - xenheap_pages; - printk("Xen heap: %lu pages Dom heap: %lu pages\n", xenheap_pages, domheap_pages); + early_printk("Xen heap: %lu pages Dom heap: %lu pages\n", xenheap_pages, domheap_pages); setup_xenheap_mappings(ram_start >> PAGE_SHIFT, xenheap_pages); @@ -212,6 +212,7 @@ void __init start_xen(unsigned long boot_phys_offset, cmdline_parse(device_tree_bootargs(fdt)); setup_pagetables(boot_phys_offset, get_xen_paddr()); + setup_mm(atag_paddr, fdt_size); #ifdef EARLY_UART_ADDRESS /* TODO Need to get device tree or command line for UART address */ @@ -229,8 +230,6 @@ void __init start_xen(unsigned long boot_phys_offset, set_current((struct vcpu *)0xfffff000); /* debug sanity */ idle_vcpu[0] = current; - setup_mm(atag_paddr, fdt_size); - /* Setup Hyp vector base */ WRITE_CP32((uint32_t) hyp_traps_vector, HVBAR); printk("Set hyp vector base to %"PRIx32" (expected %p)\n", -- 1.7.2.5