From: Julien Grall Date: Wed, 1 Oct 2014 15:13:41 +0000 (+0100) Subject: xen/arm: p2m: Correctly initialize cur_offset X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~4286 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=fb61d8fd8e50d0233e12d2e22d1ddb41af03e5db;p=xen.git xen/arm: p2m: Correctly initialize cur_offset {~0,} only initializes the first cell of the array to ~0. The other cells are initialized to 0. Explicitly initialize every cells of the array and, at the same time, do the same for the mappings. This is fixing boot after 82985d7 "xen: arm: handle variable p2m levels in apply_p2m_changes" on platform where the root-level doesn't have concatenate table (such as the Foundation Model). Signed-off-by: Julien Grall Acked-by: Ian Campbell --- diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 70929fca2b..7044431937 100644 --- a/xen/arch/arm/p2m.c +++ b/xen/arch/arm/p2m.c @@ -716,11 +716,11 @@ static int apply_p2m_changes(struct domain *d, { int rc, ret; struct p2m_domain *p2m = &d->arch.p2m; - lpae_t *mappings[4] = { NULL, }; + lpae_t *mappings[4] = { NULL, NULL, NULL, NULL }; paddr_t addr, orig_maddr = maddr; unsigned int level = 0; unsigned int cur_root_table = ~0; - unsigned int cur_offset[4] = { ~0, }; + unsigned int cur_offset[4] = { ~0, ~0, ~0, ~0 }; unsigned int count = 0; bool_t flush = false; bool_t flush_pt;