From patchwork Tue Sep 10 14:48:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julien Grall X-Patchwork-Id: 19910 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f200.google.com (mail-vc0-f200.google.com [209.85.220.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 715DE246A4 for ; Tue, 10 Sep 2013 14:49:33 +0000 (UTC) Received: by mail-vc0-f200.google.com with SMTP id hf12sf8892518vcb.3 for ; Tue, 10 Sep 2013 07:49:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=cky2jZyxWwuepkKBhTeSgDVWkbrfT/R4q2gMfy81FMs=; b=Pxs+xppfpD2zQzgASAo6kY1fP7kI1YcsuyyuT+hM0XiWk+aG6+L7UIH7XNdEMzJoPz 4obquTApIdeWJCAy+cym/7PJl6FLAehiGRh8c7acLgO3BFanMGUk/rOT10vuYfa3btwz q6lc31rjCqduFyygsslp5QzlVk/o73Gnk32qWct0fseoV6iHA3SWJkKh0saOlebgep0H l3RTTCCMGoXVcxeuBfDk0MEEsR24iETVBMpk55XF9Hvj41y0TnkjZwRHjIq6ii+Es7+x tVN/XGSEcWMDZpkmmonELLE/mXCGFfnQ2kJqpKmEarEMhVKK74X2N5Hjd4MLmSLu3gGl h7DA== X-Received: by 10.236.207.103 with SMTP id m67mr8451136yho.1.1378824573244; Tue, 10 Sep 2013 07:49:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.121.231 with SMTP id ln7ls2240152qeb.57.gmail; Tue, 10 Sep 2013 07:49:33 -0700 (PDT) X-Received: by 10.58.19.162 with SMTP id g2mr23601705vee.12.1378824573022; Tue, 10 Sep 2013 07:49:33 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id jc7si2517506vdb.78.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.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.220.181; Received: by mail-vc0-f181.google.com with SMTP id hz10so4962166vcb.26 for ; Tue, 10 Sep 2013 07:49:32 -0700 (PDT) X-Gm-Message-State: ALoCoQmKLo/908aF8CbDa+VJZffor667abv9oWup3A55QTZbY97qZXIi4MLO4ZlM7ti5+kUYAW6y X-Received: by 10.52.122.68 with SMTP id lq4mr10651127vdb.21.1378824572928; Tue, 10 Sep 2013 07:49:32 -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 u4csp4654vcz; Tue, 10 Sep 2013 07:49:32 -0700 (PDT) X-Received: by 10.15.63.2 with SMTP id l2mr326627eex.93.1378824571623; Tue, 10 Sep 2013 07:49:31 -0700 (PDT) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx.google.com with ESMTPS id z8si15288215eee.263.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:31 -0700 (PDT) Received-SPF: neutral (google.com: 74.125.83.54 is neither permitted nor denied by best guess record for domain of julien.grall@linaro.org) client-ip=74.125.83.54; Received: by mail-ee0-f54.google.com with SMTP id e53so3957019eek.13 for ; Tue, 10 Sep 2013 07:49:31 -0700 (PDT) X-Received: by 10.14.109.201 with SMTP id s49mr4636125eeg.54.1378824571023; Tue, 10 Sep 2013 07:49:31 -0700 (PDT) Received: from belegaer.uk.xensource.com. ([185.25.64.249]) by mx.google.com with ESMTPSA id i1sm31911644eeg.0.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 07:49:30 -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 v3 08/27] xen/dts: Check the CPU ID is not greater than NR_CPUS Date: Tue, 10 Sep 2013 15:48:56 +0100 Message-Id: <1378824555-16564-9-git-send-email-julien.grall@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1378824555-16564-1-git-send-email-julien.grall@linaro.org> References: <1378824555-16564-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.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 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 9d300ec..d2262ce 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); }