From patchwork Wed Mar 12 16:15:59 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 26144 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f198.google.com (mail-yk0-f198.google.com [209.85.160.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4936F203AB for ; Wed, 12 Mar 2014 16:17:44 +0000 (UTC) Received: by mail-yk0-f198.google.com with SMTP id 9sf54670384ykp.1 for ; Wed, 12 Mar 2014 09:17:44 -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:in-reply-to :references: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=+bPTqj8B69Gb91CQ1k6WJg9M2D7xKWoqTd3V+7TgTtg=; b=O8Rpweb5JrGj3qleSc/qrKkkDaf/706UrKAV3JK47aibhyiDVbXZyDzgJyTXqKxX9W CMeunmiGK7K1kFUI7RT72B2x0qPtADT1Z7XSPjpt5RM3C8gwiA2NWECqfSG59SAigwV0 A4UBj5pm05eTr97rOfGShl2TPdGmafc4903cdD+ADhxRhuv16k2I+OE8Vbe9QwrBLyjA 5dYNlEWpfHGNVmgpN7l1IvNdDfASSpwVWFi80oNd1iQGMWDYviqGgwmQWRg3b9OGj91G IsfRWn6+KfX+S84ypBAKSpsrQRkSC/wXldza23SX58kC9u/KwXk5ni3MLmYtYTnIcPmQ ECgw== X-Gm-Message-State: ALoCoQkSBmzj0YWuVA925z6iVcfNAn3xZwdmRG2Xf3cdC0TM/JjcWz/n66uUMGFXmi/aOtQDVG/W X-Received: by 10.236.209.134 with SMTP id s6mr15599225yho.40.1394641064058; Wed, 12 Mar 2014 09:17:44 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.230 with SMTP id i93ls3045617qge.28.gmail; Wed, 12 Mar 2014 09:17:43 -0700 (PDT) X-Received: by 10.58.168.142 with SMTP id zw14mr996930veb.33.1394641063913; Wed, 12 Mar 2014 09:17:43 -0700 (PDT) Received: from mail-vc0-f175.google.com (mail-vc0-f175.google.com [209.85.220.175]) by mx.google.com with ESMTPS id gs7si388875vdc.2.2014.03.12.09.17.43 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Mar 2014 09:17:43 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.175 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.175; Received: by mail-vc0-f175.google.com with SMTP id lh14so8243598vcb.6 for ; Wed, 12 Mar 2014 09:17:43 -0700 (PDT) X-Received: by 10.58.188.13 with SMTP id fw13mr33013vec.58.1394641063845; Wed, 12 Mar 2014 09:17:43 -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.220.78.9 with SMTP id i9csp301319vck; Wed, 12 Mar 2014 09:17:43 -0700 (PDT) X-Received: by 10.229.118.4 with SMTP id t4mr49870002qcq.9.1394641061831; Wed, 12 Mar 2014 09:17:41 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id s10si12578611qas.131.2014.03.12.09.17.41 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 12 Mar 2014 09:17:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of xen-devel-bounces@lists.xen.org designates 50.57.142.19 as permitted sender) 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 1WNlpT-0007Ff-Cs; Wed, 12 Mar 2014 16:16:27 +0000 Received: from mail6.bemta4.messagelabs.com ([85.158.143.247]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WNlpR-0007E9-KX for xen-devel@lists.xenproject.org; Wed, 12 Mar 2014 16:16:25 +0000 Received: from [85.158.143.35:51998] by server-3.bemta-4.messagelabs.com id 05/4C-13602-85880235; Wed, 12 Mar 2014 16:16:24 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-12.tower-21.messagelabs.com!1394640984!1606893!1 X-Originating-IP: [74.125.82.178] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 6.11.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 17611 invoked from network); 12 Mar 2014 16:16:24 -0000 Received: from mail-we0-f178.google.com (HELO mail-we0-f178.google.com) (74.125.82.178) by server-12.tower-21.messagelabs.com with RC4-SHA encrypted SMTP; 12 Mar 2014 16:16:24 -0000 Received: by mail-we0-f178.google.com with SMTP id u56so11608722wes.9 for ; Wed, 12 Mar 2014 09:16:24 -0700 (PDT) X-Received: by 10.194.219.132 with SMTP id po4mr42805142wjc.7.1394640984211; Wed, 12 Mar 2014 09:16:24 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id dk9sm70840335wjb.4.2014.03.12.09.16.22 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Mar 2014 09:16:23 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Wed, 12 Mar 2014 16:15:59 +0000 Message-Id: <1394640969-25583-5-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1394640969-25583-1-git-send-email-julien.grall@linaro.org> References: <1394640969-25583-1-git-send-email-julien.grall@linaro.org> Cc: stefano.stabellini@citrix.com, Julien Grall , tim@xen.org, ian.campbell@citrix.com Subject: [Xen-devel] [RFC 04/14] xen/arm: next_module: Skip module if the size is 0 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=neutral (google.com: 209.85.220.175 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 Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Archive: When the the module size is 0, it means that the module was not provided by the user. It can happen, if the user choose to boot without initrd. In this case, both fields (start and size) are zeroed. Therefore, next_module will return 0 every time if there is other non-zero module after this one. It will happend when the XSM module will be added. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/arch/arm/setup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xen/arch/arm/setup.c b/xen/arch/arm/setup.c index 959744e..31d853d 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -281,6 +281,9 @@ static paddr_t __init next_module(paddr_t s, paddr_t *end) paddr_t mod_s = mi->module[i].start; paddr_t mod_e = mod_s + mi->module[i].size; + if ( !mi->module[i].size ) + continue; + if ( mod_s < s ) continue; if ( mod_s > lowest )