From mboxrd@z Thu Jan 1 00:00:00 1970 From: Julien Grall Subject: Re: [PATCH for 4.5] xen/arm: p2m: Correctly initialize cur_offset Date: Wed, 01 Oct 2014 16:00:39 +0100 Message-ID: <542C1717.3000700@linaro.org> References: <1412088716-32557-1-git-send-email-julien.grall@linaro.org> <1412159612.4861.10.camel@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XZLOY-0007zk-Sj for xen-devel@lists.xenproject.org; Wed, 01 Oct 2014 15:00:46 +0000 Received: by mail-wi0-f173.google.com with SMTP id bs8so886054wib.12 for ; Wed, 01 Oct 2014 08:00:45 -0700 (PDT) In-Reply-To: <1412159612.4861.10.camel@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: Ian Campbell Cc: xen-devel@lists.xenproject.org, tim@xen.org, stefano.stabellini@citrix.com List-Id: xen-devel@lists.xenproject.org On 10/01/2014 11:33 AM, Ian Campbell wrote: > On Tue, 2014-09-30 at 15:51 +0100, Julien Grall wrote: >> {~0,} only initializes the first cell of the array to ~0. The other cells >> are initialized to 0. >> >> Change the initialization to a loop and, at the same time, do the same >> for the mappings. > > I'm not sure a loop is the best option here vs either { ~0, ~0, ~0, ~0 } > or a memset, but OK. Thinking a bit more, we effectively need to initialize only the first 2 cells. It's because the P2M can start either at level 0 or level 1. Anyway I will use { ~0, ~0, ~0, ~0 }. > I don't think mappings is wrong as it is though, any reason to change? { NULL, } initialize the first cell to NULL and the other to 0. As NULL is equal to (void *)0 it's fine, but I would prefer if we can get a rid of this construction. I would prefer if we do { NULL, NULL, NULL, NULL }. >> 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). > > You forgot your S-o-b. Oh right. I will resend a patch -- Julien Grall