From patchwork Wed Oct 1 15:13:41 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 38246 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-la0-f72.google.com (mail-la0-f72.google.com [209.85.215.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id DB603202E7 for ; Wed, 1 Oct 2014 15:17:05 +0000 (UTC) Received: by mail-la0-f72.google.com with SMTP id gq15sf760996lab.7 for ; Wed, 01 Oct 2014 08:17:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:date:message-id:cc:subject :precedence:list-id:list-unsubscribe:list-post:list-help :list-subscribe:mime-version:sender:errors-to:x-original-sender :x-original-authentication-results:mailing-list:list-archive :content-type:content-transfer-encoding; bh=c7lXqZilLY5hNwQAuM1a1uyPcQj9BSq3MoVgFrDMSPc=; b=myvHijzyR9gMgrinObAITS/7N6DPKBtn5gm7DMKVi7wcXgSLvcQPObV1T4u23DdkBj o9XUY3uuthnWQqBjeK0X+FFYpsri5HjUtzoUb2JPUpjQRnAHpqaUe3EyaIjGyGmwdMZU vi/ilVsU8p7X4z0DuBGaMKemhSQ4iWMvc0uRD6+OeC84yXepEx837TMaXegSfna4SaLe n5Bs7BXBbcoAoPxO2k6Ifcr0cpyxsTPKjMVNbr0pp9JSweDo6zjLVV7Pznd99SvSFoAy vz3ilQhxCiiFK3Bp2cJjIUqW8+8CTNXlHKo/hIZVDp/QEv98bdn8HKtJm1IzYWqsRzCH W3Tw== X-Gm-Message-State: ALoCoQkxatQ5+TJq37c8STrwHBNitVD2aRCb3Gd0VYEsJMflAlMGI2/gqud3nQFkDJ4q4JtmDkLZ X-Received: by 10.180.76.230 with SMTP id n6mr2288442wiw.0.1412176624540; Wed, 01 Oct 2014 08:17:04 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.42.171 with SMTP id p11ls150124lal.68.gmail; Wed, 01 Oct 2014 08:17:04 -0700 (PDT) X-Received: by 10.152.1.74 with SMTP id 10mr45943599lak.43.1412176624383; Wed, 01 Oct 2014 08:17:04 -0700 (PDT) Received: from mail-la0-f51.google.com (mail-la0-f51.google.com [209.85.215.51]) by mx.google.com with ESMTPS id lk1si2298045lac.4.2014.10.01.08.17.04 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 01 Oct 2014 08:17:04 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) client-ip=209.85.215.51; Received: by mail-la0-f51.google.com with SMTP id ge10so541675lab.38 for ; Wed, 01 Oct 2014 08:17:04 -0700 (PDT) X-Received: by 10.152.42.136 with SMTP id o8mr56003984lal.71.1412176624234; Wed, 01 Oct 2014 08:17:04 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.130.169 with SMTP id of9csp551265lbb; Wed, 1 Oct 2014 08:17:03 -0700 (PDT) X-Received: by 10.52.137.2 with SMTP id qe2mr35595359vdb.11.1412176623039; Wed, 01 Oct 2014 08:17:03 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id b2si902033vcn.32.2014.10.01.08.17.02 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 01 Oct 2014 08:17:03 -0700 (PDT) Received-SPF: none (google.com: xen-devel-bounces@lists.xen.org does not designate permitted sender hosts) client-ip=50.57.142.19; Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XZLbE-0000BH-RX; Wed, 01 Oct 2014 15:13:52 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1XZLbD-0000BC-Vm for xen-devel@lists.xenproject.org; Wed, 01 Oct 2014 15:13:52 +0000 Received: from [193.109.254.147:14520] by server-6.bemta-14.messagelabs.com id 37/EC-01867-F2A1C245; Wed, 01 Oct 2014 15:13:51 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-10.tower-27.messagelabs.com!1412176430!12786777!1 X-Originating-IP: [74.125.82.52] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 6.12.2; banners=-,-,- X-VirusChecked: Checked Received: (qmail 15484 invoked from network); 1 Oct 2014 15:13:50 -0000 Received: from mail-wg0-f52.google.com (HELO mail-wg0-f52.google.com) (74.125.82.52) by server-10.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 1 Oct 2014 15:13:50 -0000 Received: by mail-wg0-f52.google.com with SMTP id a1so749889wgh.23 for ; Wed, 01 Oct 2014 08:13:50 -0700 (PDT) X-Received: by 10.180.95.66 with SMTP id di2mr15443892wib.60.1412176430318; Wed, 01 Oct 2014 08:13:50 -0700 (PDT) Received: from belegaer.uk.xensource.com ([185.25.64.249]) by mx.google.com with ESMTPSA id c7sm18888068wib.12.2014.10.01.08.13.48 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Oct 2014 08:13:49 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 1 Oct 2014 16:13:41 +0100 Message-Id: <1412176421-20606-1-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [PATCH v2 for 4.5] xen/arm: p2m: Correctly initialize cur_offset X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: List-Unsubscribe: , List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: julien.grall@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.51 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: {~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 --- This is a bug fix for Xen 4.5. This make Xen booting again on the Foundation Model and any platform that doesn't have concatenate table for root-level. Changes in v2: - Add missing Signed-off-by - Explicitly initialize every cells rather than using a loop --- xen/arch/arm/p2m.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/arch/arm/p2m.c b/xen/arch/arm/p2m.c index 70929fc..7044431 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;