From patchwork Wed Aug 28 14:47:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19575 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qe0-f70.google.com (mail-qe0-f70.google.com [209.85.128.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 20B5A25E58 for ; Wed, 28 Aug 2013 14:48:22 +0000 (UTC) Received: by mail-qe0-f70.google.com with SMTP id a11sf7002809qen.5 for ; Wed, 28 Aug 2013 07:48:22 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=KbHtlquw5xT5NaaAMTJ4p+HR0yew5wbs29QpDbqDk6E=; b=eokZiWTUE9oJxCotUQE7hFCE9yr9FGz6al1Ns1q+X/kYr97oBB102zZhvZVorSBk5S pNqULt8fGjgiKd2TguJNmR8y/aV871h2x0Z6qacOKzFyJEY0/1qaLkZq+KbLP35/b8ON gDMopYmpZBU9+ySx9GlFabkq3SgBA0Oq1Ms51lCx2Y/OCPWm55+aTt/VDpVs/5oKYcVa OIDcQu+1F93m/MVsh+A4jWJdmpq+7kFBb5kXBThJu6aJ7vdKpwJLicImaeN2KwwCmLKZ oifXawkFdo4z02vvT3Q5LHhaF302NHCsfTVJAh3TKt7BJplEeDmkRv1vci7dSLgMiFQ1 5K3Q== X-Received: by 10.236.24.195 with SMTP id x43mr10070537yhx.3.1377701301996; Wed, 28 Aug 2013 07:48:21 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.15.8 with SMTP id t8ls379237qec.27.gmail; Wed, 28 Aug 2013 07:48:21 -0700 (PDT) X-Received: by 10.59.8.232 with SMTP id dn8mr25696884ved.8.1377701301844; Wed, 28 Aug 2013 07:48:21 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id sn2si6616245vec.102.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:21 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.172 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.172; Received: by mail-vc0-f172.google.com with SMTP id m17so4107403vca.17 for ; Wed, 28 Aug 2013 07:48:21 -0700 (PDT) X-Gm-Message-State: ALoCoQkUQRyr9B993wC8RvjkTjgLq8ojmOUGKdoTNaLBEhxE9EoArixryD7vqPUOiDHUhLtJvY6P X-Received: by 10.58.97.138 with SMTP id ea10mr299913veb.38.1377701301766; Wed, 28 Aug 2013 07:48:21 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp359947vcz; Wed, 28 Aug 2013 07:48:21 -0700 (PDT) X-Received: by 10.194.48.74 with SMTP id j10mr3697581wjn.41.1377701300644; Wed, 28 Aug 2013 07:48:20 -0700 (PDT) Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com [209.85.212.175]) by mx.google.com with ESMTPS id gt9si925387wib.43.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:20 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.175 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=209.85.212.175; Received: by mail-wi0-f175.google.com with SMTP id hi5so1361249wib.8 for ; Wed, 28 Aug 2013 07:48:20 -0700 (PDT) X-Received: by 10.194.216.68 with SMTP id oo4mr857496wjc.92.1377701300096; Wed, 28 Aug 2013 07:48:20 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id a8sm5590498wie.6.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 28 Aug 2013 07:48:19 -0700 (PDT) From: Julien Grall To: xen-devel@lists.xen.org Cc: stefano.stabellini@eu.citrix.com, ian.campbell@citrix.com, patches@linaro.org, andre.przywara@linaro.org, Julien Grall Subject: [PATCH V1 12/29] xen/dts: Check the CPU ID is not greater than NR_CPUS Date: Wed, 28 Aug 2013 15:47:26 +0100 Message-Id: <1377701263-3319-13-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1377701263-3319-1-git-send-email-julien.grall@linaro.org> References: <1377701263-3319-1-git-send-email-julien.grall@linaro.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.172 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 Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On some board CPU IDs are not contiguous (for instance the Versatile Express with big.LITTLE supports). If the CPU ID is greater than NR_CPUS Xen will hang without any message. This is because console driver is not yet initialized and hypervisor data abort uses printk. For the moment check the CPU ID and print an warning if an error occured. Signed-off-by: Julien Grall Acked-by: Ian Campbell --- xen/common/device_tree.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/xen/common/device_tree.c b/xen/common/device_tree.c index 7295f34..5b4dde3 100644 --- a/xen/common/device_tree.c +++ b/xen/common/device_tree.c @@ -445,6 +445,13 @@ static void __init process_cpu_node(const void *fdt, int node, cpuid = dt_read_number((const __be32 *)prop->data, 1); + /* TODO: handle non-contiguous CPU ID */ + if ( cpuid >= NR_CPUS ) + { + dt_printk("fdt: node `%s': reg(0x%x) >= NR_CPUS(%d)\n", + name, cpuid, NR_CPUS); + return; + } cpumask_set_cpu(cpuid, &cpu_possible_map); }