From patchwork Mon Mar 17 14:05:54 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 26367 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 163CE202FA for ; Mon, 17 Mar 2014 14:07:30 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id w5sf12234975qac.0 for ; Mon, 17 Mar 2014 07:07:29 -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=bn71lcSnsmkg+gmj4SZIxjpSH+lj95xqhSrEAkztuKQ=; b=h0NV1cQWJOtdbBAD90TQVYs/ZRXZO+Fde4oi+rlMru/dMofrwxV2VZ0NJ2Y5+twLrK eAPwoznsVBHQgtbDxfLxo2oLByM8ty+VXJAyA5u8522O5NixKBueOUpaReJRwP1fJhRe dR4M2PC0koDZtnk041GCaal5RgE5X3q5QrZ8QgRclC1ZLxy/VuCrC2sKSnEMipX3jvDE 8MqDJg77fF4VDkGy9Rqkt9nEyxtXGyCoOH+k7H5ZISLpXOa7YF6/qS/brBW1zaqWwq+N Y+QUbl9bbrSzeF1MpVhS40JvH8uLQ/2VVFt9CeZicfpWC9XhV8sFGmKMW3Q1vBC9Ciu1 hNNg== X-Gm-Message-State: ALoCoQmvSTIKpM/RzIstxEdfQqkbx+MhZmu0F0yThGgCuq0Zl5YT2YBk+RgfUzYyYRZ0Gi7e3KRo X-Received: by 10.52.94.47 with SMTP id cz15mr8144793vdb.0.1395065249821; Mon, 17 Mar 2014 07:07:29 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.92.85 with SMTP id a79ls1663924qge.72.gmail; Mon, 17 Mar 2014 07:07:29 -0700 (PDT) X-Received: by 10.221.55.133 with SMTP id vy5mr20089119vcb.17.1395065249684; Mon, 17 Mar 2014 07:07:29 -0700 (PDT) Received: from mail-ve0-f181.google.com (mail-ve0-f181.google.com [209.85.128.181]) by mx.google.com with ESMTPS id fn10si1037647vdc.135.2014.03.17.07.07.29 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 17 Mar 2014 07:07:29 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.128.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.181; Received: by mail-ve0-f181.google.com with SMTP id oy12so5839181veb.12 for ; Mon, 17 Mar 2014 07:07:29 -0700 (PDT) X-Received: by 10.220.133.80 with SMTP id e16mr20219096vct.13.1395065249603; Mon, 17 Mar 2014 07:07:29 -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 i9csp130034vck; Mon, 17 Mar 2014 07:07:29 -0700 (PDT) X-Received: by 10.140.51.161 with SMTP id u30mr9965333qga.69.1395065248625; Mon, 17 Mar 2014 07:07:28 -0700 (PDT) Received: from lists.xen.org (lists.xen.org. [50.57.142.19]) by mx.google.com with ESMTPS id y4si8596048qad.121.2014.03.17.07.07.28 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Mon, 17 Mar 2014 07:07:28 -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 1WPYBP-0002Dz-4W; Mon, 17 Mar 2014 14:06:27 +0000 Received: from mail6.bemta14.messagelabs.com ([193.109.254.103]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WPYBJ-0002Cr-QB for xen-devel@lists.xenproject.org; Mon, 17 Mar 2014 14:06:22 +0000 Received: from [193.109.254.147:33330] by server-16.bemta-14.messagelabs.com id 4E/FA-16986-D5107235; Mon, 17 Mar 2014 14:06:21 +0000 X-Env-Sender: julien.grall@linaro.org X-Msg-Ref: server-5.tower-27.messagelabs.com!1395065180!2205351!1 X-Originating-IP: [74.125.83.43] 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 15250 invoked from network); 17 Mar 2014 14:06:20 -0000 Received: from mail-ee0-f43.google.com (HELO mail-ee0-f43.google.com) (74.125.83.43) by server-5.tower-27.messagelabs.com with RC4-SHA encrypted SMTP; 17 Mar 2014 14:06:20 -0000 Received: by mail-ee0-f43.google.com with SMTP id e53so4163391eek.2 for ; Mon, 17 Mar 2014 07:06:20 -0700 (PDT) X-Received: by 10.14.6.1 with SMTP id 1mr8292663eem.71.1395065180193; Mon, 17 Mar 2014 07:06:20 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id x3sm39716538eep.17.2014.03.17.07.06.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Mar 2014 07:06:18 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xenproject.org Date: Mon, 17 Mar 2014 14:05:54 +0000 Message-Id: <1395065165-15915-5-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1395065165-15915-1-git-send-email-julien.grall@linaro.org> References: <1395065165-15915-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] [PATCH v2 04/15] 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.128.181 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. This can happen when the XSM module is added. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- Changes in v2: - Fix typo in commit message --- 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 d59e7f8..215ec24 100644 --- a/xen/arch/arm/setup.c +++ b/xen/arch/arm/setup.c @@ -284,6 +284,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 )