From patchwork Fri Sep 13 12:49:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 20027 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id A167028E96 for ; Fri, 13 Sep 2013 12:49:43 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id b4sf1188986qen.9 for ; Fri, 13 Sep 2013 05:49:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=RNDh0iQK+fphtxIbUxdOmbRRgnrstCTHmhW92jC2PwA=; b=TdR44Y3o9HCgeyywZ0NVbwZ6HhDjdkAPGAf943BcoDfnycQJ5wZHzRQJ1k2lxS7qPd Lu2xkgltiBo20EPZhz1bMg58gcXDXAxPUe+PyRQmtqBAEozPNee8z21dfgTanO5ROZzK F3+gapGyCUT8EcFV88HssGSooZZh2ZXE/Ctmsd/WZXosU6Fl6sbrjnTIke8YBFsmGpJ8 Jz7M0MKS4vKTzGbdLg71mczxaNjxUsQ+ZBulZXnACfUj1lYgnZhMoKCYqNaiEpT5Nqsy yAY/5eompdZGvmPSLelQOr70K4fMD8cRWFUvVgpremawbQ/PmgzP0Th7MA8uaoQ05epc c54w== X-Gm-Message-State: ALoCoQlh1KorStLmVZOvESC8KxyJ/IxyTtAjp25EBXxshwHOldnRzNsaFenZ4QCN0W+OA+L4F26k X-Received: by 10.236.19.225 with SMTP id n61mr4928313yhn.8.1379076582049; Fri, 13 Sep 2013 05:49:42 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.74.69 with SMTP id r5ls1177003qev.1.gmail; Fri, 13 Sep 2013 05:49:41 -0700 (PDT) X-Received: by 10.220.42.140 with SMTP id s12mr99099vce.33.1379076581771; Fri, 13 Sep 2013 05:49:41 -0700 (PDT) Received: from mail-vc0-f173.google.com (mail-vc0-f173.google.com [209.85.220.173]) by mx.google.com with ESMTPS id oh2si3091607vcb.10.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:49:41 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.173; Received: by mail-vc0-f173.google.com with SMTP id if17so404431vcb.4 for ; Fri, 13 Sep 2013 05:49:41 -0700 (PDT) X-Received: by 10.52.74.100 with SMTP id s4mr542385vdv.35.1379076581565; Fri, 13 Sep 2013 05:49:41 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp78761vcz; Fri, 13 Sep 2013 05:49:40 -0700 (PDT) X-Received: by 10.14.246.11 with SMTP id p11mr18336731eer.9.1379076579700; Fri, 13 Sep 2013 05:49:39 -0700 (PDT) Received: from mail-ee0-f41.google.com (mail-ee0-f41.google.com [74.125.83.41]) by mx.google.com with ESMTPS id o7si3770405eep.318.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:49:39 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.41 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.41; Received: by mail-ee0-f41.google.com with SMTP id d17so563701eek.0 for ; Fri, 13 Sep 2013 05:49:39 -0700 (PDT) X-Received: by 10.14.213.68 with SMTP id z44mr2702487eeo.70.1379076579125; Fri, 13 Sep 2013 05:49:39 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id p5sm14678420eeg.5.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 13 Sep 2013 05:49:38 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, andre.przywara@linaro.org, Julien Grall Subject: [PATCH v4 01/27] xen/dts: Constify device_tree_flattened Date: Fri, 13 Sep 2013 13:49:08 +0100 Message-Id: <1379076574-28316-2-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1379076574-28316-1-git-send-email-julien.grall@linaro.org> References: <1379076574-28316-1-git-send-email-julien.grall@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.173 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , The Flat Device Tree is given by the bootloader. Xen doesn't need to modify it. Signed-off-by: Julien Grall --- Changes in v3: - Fix compilation on arm64 --- xen/arch/arm/domain_build.c | 2 +- xen/arch/arm/setup.c | 12 ++++++++---- xen/common/device_tree.c | 2 +- xen/include/xen/device_tree.h | 2 +- 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/xen/arch/arm/domain_build.c b/xen/arch/arm/domain_build.c index 77e2a61..bde041e 100644 --- a/xen/arch/arm/domain_build.c +++ b/xen/arch/arm/domain_build.c @@ -475,7 +475,7 @@ static int map_devices_from_device_tree(struct domain *d) static int prepare_dtb(struct domain *d, struct kernel_info *kinfo) { - void *fdt; + const void *fdt; int new_size; int ret; paddr_t end; diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 4b31623..aa87fb1 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -289,6 +289,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) unsigned long dtb_pages; unsigned long boot_mfn_start, boot_mfn_end; int i = 0; + void *fdt; /* TODO: Handle non-contiguous memory bank */ if ( !early_info.mem.nr_banks ) @@ -363,8 +364,9 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) * * TODO: handle other payloads too. */ - device_tree_flattened = mfn_to_virt(alloc_boot_pages(dtb_pages, 1)); - copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE); + fdt = mfn_to_virt(alloc_boot_pages(dtb_pages, 1)); + copy_from_paddr(fdt, dtb_paddr, dtb_size, BUFFERABLE); + device_tree_flattened = fdt; /* Add non-xenheap memory */ s = ram_start; @@ -410,6 +412,7 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) int bank; unsigned long xenheap_pages = 0; unsigned long dtb_pages; + void *fdt; total_pages = 0; for ( bank = 0 ; bank < early_info.mem.nr_banks; bank++ ) @@ -469,8 +472,9 @@ static void __init setup_mm(unsigned long dtb_paddr, size_t dtb_size) * * TODO: handle other payloads too. */ - device_tree_flattened = mfn_to_virt(alloc_boot_pages(dtb_pages, 1)); - copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE); + fdt = mfn_to_virt(alloc_boot_pages(dtb_pages, 1)); + copy_from_paddr(fdt, dtb_paddr, dtb_size, BUFFERABLE); + device_tree_flattened = fdt; setup_frametable_mappings(ram_start, ram_end); max_page = PFN_DOWN(ram_end); diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index c4f0f2c..a5abdaa 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -26,7 +26,7 @@ #include struct dt_early_info __initdata early_info; -void *device_tree_flattened; +const void *device_tree_flattened; dt_irq_xlate_func dt_irq_xlate; /* Host device tree */ struct dt_device_node *dt_host; diff --git a/xen/include/xen/device_tree.h b/xen/include/xen/device_tree.h index 5cc1905..2e5564e 100644 --- a/xen/include/xen/device_tree.h +++ b/xen/include/xen/device_tree.h @@ -164,7 +164,7 @@ typedef int (*device_tree_node_func)(const void *fdt, void *data); extern struct dt_early_info early_info; -extern void *device_tree_flattened; +extern const void *device_tree_flattened; size_t __init device_tree_early_init(const void *fdt);