From patchwork Fri Apr 15 13:31:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 610973 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from huckleberry.canonical.com (huckleberry.canonical.com [91.189.94.19]) by ozlabs.org (Postfix) with ESMTP id 3qmdkC007Wz9t6B; Fri, 15 Apr 2016 23:32:02 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=canonical-com.20150623.gappssmtp.com header.i=@canonical-com.20150623.gappssmtp.com header.b=UpqVCssW; dkim-atps=neutral Received: from localhost ([127.0.0.1] helo=huckleberry.canonical.com) by huckleberry.canonical.com with esmtp (Exim 4.76) (envelope-from ) id 1ar3qp-0004RT-OY; Fri, 15 Apr 2016 13:31:59 +0000 Received: from mail-ig0-f180.google.com ([209.85.213.180]) by huckleberry.canonical.com with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16) (Exim 4.76) (envelope-from ) id 1ar3qc-0004N4-Mv for kernel-team@lists.ubuntu.com; Fri, 15 Apr 2016 13:31:46 +0000 Received: by mail-ig0-f180.google.com with SMTP id gy3so19532403igb.0 for ; Fri, 15 Apr 2016 06:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id:in-reply-to:references; bh=7cO/OCbLbEouzCLRn/yo81iiaS69rwVT9TlywybLj5M=; b=UpqVCssWEhd1PToPUy6LFf8t6au1pKtDzGz10Ydd7BGnfrSTvQqQ7Cy0a2qYSsPzLx LV8uECj/+kdhKNGXaiWtsgqdS+E+2n30xTUC/7f8OLo4JHqdUrxvee1jktk9HtyZ01H0 k5C+2HSW/GBB5P8zrxFffM1ISC3U3VT6YGqAFVAFu0B9+68mRExcycuUnef7D8oe4Rxb /H0ST3YOVfp+1k6f+YzXeqmb1+gTZZT7oQF+defwYvH2fgIUPhjYYmE0aWgX7RO166jg KcUk/vACurZvJ7DbbOzU40WMfYLRI3pf8TZNAqhZCRL3AOk3ZLq/l/tO+XQUIE5fB6xp vZ6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references; bh=7cO/OCbLbEouzCLRn/yo81iiaS69rwVT9TlywybLj5M=; b=iQFNXGIPeHRo7fiELenSrweAZxGYa+Gtd4SXm96TDK7TQGrz69xB98ROa8vgnAYVxA 4wEm/g/3rb+oZ2c1H8HrXyeUJoO6Mh0mAviFfG68fTaTJ4cB2avNlr2Q7h27DMDu5P6J tBO6ZT601wJ8kbmA6f4FVhjcqVapmWxhQDRJm830wiS1XbFRBu/D4bfYjein7/wYt+YJ lkEbKocpOgYuLv83WcwF3EqBzjt/ugUcdU5it9LqMIsO2equy8GMrPaBKcNnyShrj38X tIPi0pa+81dQ0zxWpTK1CFXRguFVBwolO8b1RB97RTf2yixay34+eZAELr3jFrrdalrT fcsQ== X-Gm-Message-State: AOPr4FW/juQRVtRUISPTey9V2ij8zk2OslKcEHnuyYJ4y4gxvXeH17fWOaKovO7eMEl1FXyf X-Received: by 10.50.232.47 with SMTP id tl15mr4747723igc.64.1460727104556; Fri, 15 Apr 2016 06:31:44 -0700 (PDT) Received: from localhost.localdomain (host-174-45-44-32.hln-mt.client.bresnan.net. [174.45.44.32]) by smtp.gmail.com with ESMTPSA id u3sm20163448igq.15.2016.04.15.06.31.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Apr 2016 06:31:44 -0700 (PDT) From: tim.gardner@canonical.com To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/5 Xenial SRU] x86/topology: Fix Intel HT disable Date: Fri, 15 Apr 2016 07:31:27 -0600 Message-Id: <1460727090-28549-3-git-send-email-tim.gardner@canonical.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1460727090-28549-1-git-send-email-tim.gardner@canonical.com> References: <5710E3D3.50206@canonical.com> <1460727090-28549-1-git-send-email-tim.gardner@canonical.com> X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.14 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: kernel-team-bounces@lists.ubuntu.com From: Peter Zijlstra BugLink: http://bugs.launchpad.net/bugs/1570441 As per the comment in the code; due to BIOS it is sometimes impossible to know if there actually are smp siblings until the machine is fully enumerated. So we rather overestimate the number of possible packages. Fixes: 1f12e32f4cd5 ("x86/topology: Create logical package id") Signed-off-by: Peter Zijlstra (Intel) Cc: aherrmann@suse.com Cc: jencce.kernel@gmail.com Cc: bp@alien8.de Cc: Mike Galbraith Link: http://lkml.kernel.org/r/20160318150538.611014173@infradead.org Signed-off-by: Thomas Gleixner (cherry picked from commit 63d1e995be455ae9196270eb4b789de21afd42ed) Signed-off-by: Tim Gardner --- arch/x86/kernel/smpboot.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index f2a2b70..bf38a1c 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -312,8 +312,21 @@ static void __init smp_init_package_map(void) /* * Today neither Intel nor AMD support heterogenous systems. That * might change in the future.... + * + * While ideally we'd want '* smp_num_siblings' in the below @ncpus + * computation, this won't actually work since some Intel BIOSes + * report inconsistent HT data when they disable HT. + * + * In particular, they reduce the APIC-IDs to only include the cores, + * but leave the CPUID topology to say there are (2) siblings. + * This means we don't know how many threads there will be until + * after the APIC enumeration. + * + * By not including this we'll sometimes over-estimate the number of + * logical packages by the amount of !present siblings, but this is + * still better than MAX_LOCAL_APIC. */ - ncpus = boot_cpu_data.x86_max_cores * smp_num_siblings; + ncpus = boot_cpu_data.x86_max_cores; __max_logical_packages = DIV_ROUND_UP(nr_cpu_ids, ncpus); /*