From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xen.org
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH V2 22/40] arm: use correct attributes for mappings in copy_from_paddr()
Date: Tue, 26 Jun 2012 10:29:46 +0000 [thread overview]
Message-ID: <1340706604-1313-22-git-send-email-ian.campbell@citrix.com> (raw)
In-Reply-To: <1340706604-1313-1-git-send-email-ian.campbell@citrix.com>
The DTB is in RAM (hence bufferable), kernel is in flash and therefor requires
a device type mapping (hence dev shared).
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Acked-by: David Vrabel <david.vrabel@citrix.com>
---
xen/arch/arm/kernel.c | 8 ++++----
xen/arch/arm/setup.c | 2 +-
xen/include/asm-arm/page.h | 15 +++++++++++++++
xen/include/asm-arm/setup.h | 2 +-
4 files changed, 21 insertions(+), 6 deletions(-)
diff --git a/xen/arch/arm/kernel.c b/xen/arch/arm/kernel.c
index 130d488..2d56130 100644
--- a/xen/arch/arm/kernel.c
+++ b/xen/arch/arm/kernel.c
@@ -39,7 +39,7 @@ struct minimal_dtb_header {
* @paddr: source physical address
* @len: length to copy
*/
-void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
+void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len, int attrindx)
{
void *src = (void *)FIXMAP_ADDR(FIXMAP_MISC);
@@ -51,7 +51,7 @@ void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len)
s = paddr & (PAGE_SIZE-1);
l = min(PAGE_SIZE - s, len);
- set_fixmap(FIXMAP_MISC, p, DEV_SHARED);
+ set_fixmap(FIXMAP_MISC, p, attrindx);
memcpy(dst, src + s, l);
paddr += l;
@@ -111,7 +111,7 @@ static int kernel_try_zimage_prepare(struct kernel_info *info)
/*
* Check for an appended DTB.
*/
- copy_from_paddr(&dtb_hdr, KERNEL_FLASH_ADDRESS + end - start, sizeof(dtb_hdr));
+ copy_from_paddr(&dtb_hdr, KERNEL_FLASH_ADDRESS + end - start, sizeof(dtb_hdr), DEV_SHARED);
if (be32_to_cpu(dtb_hdr.magic) == DTB_MAGIC) {
end += be32_to_cpu(dtb_hdr.total_size);
}
@@ -151,7 +151,7 @@ static int kernel_try_elf_prepare(struct kernel_info *info)
if ( info->kernel_img == NULL )
panic("Cannot allocate temporary buffer for kernel.\n");
- copy_from_paddr(info->kernel_img, KERNEL_FLASH_ADDRESS, KERNEL_FLASH_SIZE);
+ copy_from_paddr(info->kernel_img, KERNEL_FLASH_ADDRESS, KERNEL_FLASH_SIZE, DEV_SHARED);
if ( (rc = elf_init(&info->elf.elf, info->kernel_img, KERNEL_FLASH_SIZE )) != 0 )
return rc;
diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c
index d6c0178..fd70553 100644
--- a/xen/arch/arm/setup.c
+++ b/xen/arch/arm/setup.c
@@ -122,7 +122,7 @@ 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);
+ copy_from_paddr(device_tree_flattened, dtb_paddr, dtb_size, BUFFERABLE);
/* Add non-xenheap memory */
init_boot_pages(pfn_to_paddr(xenheap_mfn_start + xenheap_pages),
diff --git a/xen/include/asm-arm/page.h b/xen/include/asm-arm/page.h
index 6efe23c..2b6c1780 100644
--- a/xen/include/asm-arm/page.h
+++ b/xen/include/asm-arm/page.h
@@ -36,6 +36,14 @@
#define MAIR0VAL 0xeeaa4400
#define MAIR1VAL 0xff000004
+/*
+ * Attribute Indexes.
+ *
+ * These are valid in the AttrIndx[2:0] field of an LPAE stage 1 page
+ * table entry. They are indexes into the bytes of the MAIR*
+ * registers, as defined above.
+ *
+ */
#define UNCACHED 0x0
#define BUFFERABLE 0x1
#define WRITETHROUGH 0x2
@@ -46,6 +54,13 @@
#define DEV_WC BUFFERABLE
#define DEV_CACHED WRITEBACK
+/*
+ * Stage 2 Memory Type.
+ *
+ * These are valid in the MemAttr[3:0] field of an LPAE stage 2 page
+ * table entry.
+ *
+ */
#define MATTR_DEV 0x1
#define MATTR_MEM 0xf
diff --git a/xen/include/asm-arm/setup.h b/xen/include/asm-arm/setup.h
index 05ff89e..6433b4e 100644
--- a/xen/include/asm-arm/setup.h
+++ b/xen/include/asm-arm/setup.h
@@ -3,7 +3,7 @@
#include <public/version.h>
-void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len);
+void copy_from_paddr(void *dst, paddr_t paddr, unsigned long len, int attrindx);
void arch_get_xen_caps(xen_capabilities_info_t *info);
--
1.7.9.1
next prev parent reply other threads:[~2012-06-26 10:29 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-26 10:29 [PATCH 00/40 V2] arm: boot a dom1 to "Calibrating delay loop" then hang Ian Campbell
2012-06-26 10:29 ` [PATCH V2 01/40] arm: allocate top level p2m page for all non-idle domains Ian Campbell
2012-06-26 10:29 ` [PATCH V2 02/40] arm: handy function to print a walk of a page table Ian Campbell
2012-06-26 10:29 ` [PATCH V2 03/40] arm: correct and expand TLB flush CP15 registers Ian Campbell
2012-06-26 10:29 ` [PATCH V2 04/40] arm: restore stack on return from trap Ian Campbell
2012-06-26 10:29 ` [PATCH V2 05/40] arm: enable interrupts while handling traps Ian Campbell
2012-06-26 10:29 ` [PATCH V2 06/40] arm: hook up domctl and memory_op Ian Campbell
2012-06-26 10:29 ` [PATCH V2 07/40] arm: allocate and setup a guest vcpu Ian Campbell
2012-06-26 10:29 ` [PATCH V2 08/40] arm: print domid as part of debug trap Ian Campbell
2012-06-26 10:29 ` [PATCH V2 09/40] arm: remove unnecessarily verbose print from p2m_load_VTTBR Ian Campbell
2012-06-26 10:29 ` [PATCH V2 10/40] arm: implement p2m lookup Ian Campbell
2012-06-26 10:29 ` [PATCH V2 11/40] arm: remove hard tabs from init_idle_domain Ian Campbell
2012-06-26 10:29 ` [PATCH V2 12/40] arm: stub out sync_vcpu_execstate Ian Campbell
2012-06-26 10:29 ` [PATCH V2 13/40] arm: implement stub version of flush_tlb_mask Ian Campbell
2012-06-26 10:29 ` [PATCH V2 14/40] arm: do not set max_vcpus = 8 in arch_domain_create Ian Campbell
2012-06-26 10:29 ` [PATCH V2 15/40] arm: Add simple cpu_{sibling, core}_mask Ian Campbell
2012-06-26 10:29 ` [PATCH V2 16/40] arm: allow p2m to be created with specific MATTR Ian Campbell
2012-06-28 12:46 ` Ian Campbell
2012-06-28 13:00 ` Stefano Stabellini
2012-06-26 10:29 ` [PATCH V2 17/40] arm: implement vpl011 (UART) emulator Ian Campbell
2012-06-28 11:00 ` Tim Deegan
2012-06-26 10:29 ` [PATCH V2 18/40] arm: context switch a bunch of guest state Ian Campbell
2012-06-26 10:29 ` [PATCH V2 19/40] arm: dump a page table walk when va_to_par fails Ian Campbell
2012-06-26 10:29 ` [PATCH V2 20/40] arm: dump guest s1 walk on data abort which is not a stage 2 issue Ian Campbell
2012-06-26 10:29 ` [PATCH V2 21/40] arm: implement vcpu_show_execution_state Ian Campbell
2012-06-28 13:04 ` Stefano Stabellini
2012-06-26 10:29 ` Ian Campbell [this message]
2012-06-26 10:29 ` [PATCH V2 23/40] arm: map fixmaps non-executable Ian Campbell
2012-06-26 10:29 ` [PATCH V2 24/40] arm: fix locking in create_p2m_entries Ian Campbell
2012-06-26 10:29 ` [PATCH V2 25/40] arm: split pending SPIs (global) out from pending PPIs and SGIs (per CPU) Ian Campbell
2012-06-28 13:08 ` Stefano Stabellini
2012-06-26 10:29 ` [PATCH V2 26/40] arm: use interrupt safe spin locks in vgic_vcpu_inject_irq Ian Campbell
2012-06-28 13:06 ` Stefano Stabellini
2012-06-26 10:29 ` [PATCH V2 27/40] arm: map GICV in all domains, not just dom0 Ian Campbell
2012-06-26 10:29 ` [PATCH V2 28/40] arm: enable data-cache at the same time as enabling the MMU, not before Ian Campbell
2012-06-28 11:02 ` Tim Deegan
2012-06-26 10:29 ` [PATCH V2 29/40] arm: Upgrade guest barriers to Outer-Shareable. Enable Protected Table Walk Ian Campbell
2012-06-26 10:29 ` [PATCH V2 30/40] arm: gic.lock can be taken in interrupt context, so lock appropriately Ian Campbell
2012-06-26 10:29 ` [PATCH V2 31/40] arm: context switch virtual timer registers Ian Campbell
2012-06-26 10:29 ` [PATCH V2 32/40] arm: the hyp timer seems to work in newer model versions, default to using it Ian Campbell
2012-06-26 10:29 ` [PATCH V2 33/40] arm: unwind allocations etc on arch_domain_create_failure Ian Campbell
2012-06-28 11:05 ` Tim Deegan
2012-06-26 10:29 ` [PATCH V2 34/40] HACK: arm: initial XENMAPSPACE_gmfn_foreign Ian Campbell
2012-06-26 10:29 ` [PATCH V2 35/40] arm: move PSR flag definitions into interface, for tools use Ian Campbell
2012-06-26 10:30 ` [PATCH V2 36/40] libxc: add ARM support to xc_dom (PV domain building) Ian Campbell
2012-06-26 10:30 ` [PATCH V2 37/40] arm: implement VGCF_online Ian Campbell
2012-06-28 11:06 ` Tim Deegan
2012-06-26 10:30 ` [PATCH V2 38/40] arm: fix typo s/approprately/appropriately/g Ian Campbell
2012-06-26 10:30 ` [PATCH V2 39/40] HACK: add simple xcbuild Ian Campbell
2012-06-26 10:30 ` [PATCH V2 40/40] HACK: arm: disable hypercall continuations Ian Campbell
2012-06-26 15:26 ` [PATCH 00/40 V2] arm: boot a dom1 to "Calibrating delay loop" then hang Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1340706604-1313-22-git-send-email-ian.campbell@citrix.com \
--to=ian.campbell@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).