Received: by 10.192.165.148 with SMTP id m20csp1332556imm; Wed, 2 May 2018 19:35:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZphsn0hoEccqNs2KdiefuD3mkw3wDruP/yrXac2H4d24fewT6TUESkLYpOkp6RfwwrwEsdF X-Received: by 2002:a63:a704:: with SMTP id d4-v6mr18043002pgf.324.1525314908104; Wed, 02 May 2018 19:35:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525314908; cv=none; d=google.com; s=arc-20160816; b=WlW26/otMTEA7Pg2KCWG0QCg5S+LidffCqwmsp8Jli1s0KXtinBMbWVcbRd5uz7Z3g xUdXSCLpTqgfAcMA+mkgEOPdXMC06YRlgV6hxxjU9jFpYjIRi776TQWl9rie42kDH+0G f/Da2taDQqFqGIQzjW60KTvlaNaIWkLzLbJ0GWjWqTxOkd76/9bmN5oBSCzrZh0w0ESb rvsqLm2s/k8C4Q3AlgUd3Pt05JQw6zbaWTdurgiYp0qqUcD0ShpufznxKikmwq8OpHiG FGdwmgaoPx8vpEKD+mxLPKThi7xHMBS4u/oS6EnLU/uAqz//SlwtFsUT9DgVr0wQijJi v9Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=HMA0hbwlC4zI5YEu9/wA01ioBW44far+/N9bJdoCjiQ=; b=K0RGGSz6YHbVeW/Cah3ee7SMG4XgUkBQgldwngMxYSNXKyLnDIxHX8yT4pUAL14cQb Z1mUHDarGgAROXtqJHLqIcyJpA/GATXWsveHyEbjZhRROEOT9gRmvxnM5dsgRavQlyfi edUef++5Q85whmgSaSqTzY+ToZ2wjWzyL+Rrc9E5CkgZ3Y6nxHR2Ox8+kaLoHsSrAesk Ff+N5aDAh/OkYxT7AjU51wk0RLo5z1H9BMOmIaYDX+FqijnketYYyknxi51OmH3AEjvi wOK3hbV5X430SRNqlvOECJOsxhhlZgXOHCcMn6r4ewCEWNV1uspcde0HO708mJYoGZh9 bHfA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6-v6si13027538plp.386.2018.05.02.19.34.54; Wed, 02 May 2018 19:35:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752144AbeECCd6 (ORCPT + 99 others); Wed, 2 May 2018 22:33:58 -0400 Received: from ZXSHCAS1.zhaoxin.com ([203.148.12.81]:28698 "EHLO ZXSHCAS1.zhaoxin.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752044AbeECCcz (ORCPT ); Wed, 2 May 2018 22:32:55 -0400 Received: from zxbjmbx3.zhaoxin.com (10.29.252.165) by ZXSHCAS1.zhaoxin.com (10.28.252.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Thu, 3 May 2018 10:32:53 +0800 Received: from timguo-System-Product-Name.zhaoxin.com (10.29.8.54) by zxbjmbx3.zhaoxin.com (10.29.252.165) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1261.35; Thu, 3 May 2018 10:32:52 +0800 From: David Wang To: , , , , , CC: , , , , , , David Wang Subject: [PATCH 3/3] x86/Centaur: Report correct CPU/cache topology Date: Thu, 3 May 2018 10:32:46 +0800 Message-ID: <1525314766-18910-4-git-send-email-davidwang@zhaoxin.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1525314766-18910-1-git-send-email-davidwang@zhaoxin.com> References: <1525314766-18910-1-git-send-email-davidwang@zhaoxin.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.29.8.54] X-ClientProxiedBy: zxbjmbx1.zhaoxin.com (10.29.252.163) To zxbjmbx3.zhaoxin.com (10.29.252.165) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Centaur CPUs enumerate the cache topology in the same way as Intel CPUs, but the function is unused so for. The Centaur init code also missies to initialize x86_info::max_cores, so the CPU topology can't be described correctly. Initialize x86_info::max_cores and invoke init_intel_cacheinfo() to make CPU and cache topology information available and correct. Signed-off-by: David Wang --- arch/x86/kernel/cpu/centaur.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c index 80d5110..c265494 100644 --- a/arch/x86/kernel/cpu/centaur.c +++ b/arch/x86/kernel/cpu/centaur.c @@ -160,6 +160,11 @@ static void init_centaur(struct cpuinfo_x86 *c) clear_cpu_cap(c, 0*32+31); #endif early_init_centaur(c); + init_intel_cacheinfo(c); + c->x86_max_cores = detect_num_cpu_cores(c); +#ifdef CONFIG_X86_32 + detect_ht(c); +#endif if (c->cpuid_level > 9) { unsigned int eax = cpuid_eax(10); -- 1.9.1