Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2695072ybl; Mon, 20 Jan 2020 07:40:51 -0800 (PST) X-Google-Smtp-Source: APXvYqwC1v1C9tiQ9qBvXhjgf0PiEhbBbbq3W/OL6xEfm2KSZWCQrYhZdCqN+o6d3+pRZkI+5b7N X-Received: by 2002:a9d:7757:: with SMTP id t23mr17140286otl.315.1579534850857; Mon, 20 Jan 2020 07:40:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579534850; cv=none; d=google.com; s=arc-20160816; b=XoP6VWYvfkvPphxXHYv4iOLFhDbZeTmHBV8G+OAKooAOtTsSzGhtZ2nO/da8pFa/mx 3s7AZD5ODW0fNUQlGAYeVtCly/HXI4V39lqX2H0lsUvhRTUO1KNFk8ONQ/B069iOeP0M 70GSk1Q3M/IcVQOCvypEVTjO2xsykHwhuwdurVhr0GS8JBsCJEnOMbPb1m6ud/R//nsD VZdiFwMWZj10UtCWz/7kvScywBNegKOCT2iDYb8N/p3zpF2dE4njCa/XD92Sx8sSdAz0 9pPNt81/KMhyNgo3uIZpqskaMpPAYf81ONZkArFoSsxe6FO9B6SzyrEi/n+W6G15fkim /zYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :robot-unsubscribe:robot-id:message-id:mime-version:references :in-reply-to:cc:subject:to:reply-to:from:date; bh=QmBGbtHGKL6+FDdJSwR8y3qjJTJoaNFGHtzz3/U/i/A=; b=NpLUBWJEEGw0EPGKhx5oMT8kwAvCgsCQ4MIB0Rv+vA6djZHcq+aZ0ZDl4HZuwX2Imx aicw03ns24cYIsYdmX0tcBQ6ZdtBIqMKTHFcAX0NIoQh+U7n2SNxwJKDJbJkmM/RV1zH L+wcinSRCPKtkeg3OZGhIJRgHN0+AVovqF7BM+LG+nfepj1HVIWLZ4H6cDJgjHJr0XQ2 A0aqxTJE2SnbtGXp7GqYxC4U/ZfnG8Ui2z4NnP8XJe/TXmsluUrSMA6ojnpkihkVlfMx Tnj2DF+eSKqLrhUgnrEoZ0HmYJTVkmkRQ2Lx0IqnOG9c8EoQI/NayFAU2R5Jclvrs9gB 4fIw== 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 z24si21240065otm.101.2020.01.20.07.40.39; Mon, 20 Jan 2020 07:40:50 -0800 (PST) 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 S1729091AbgATPjo (ORCPT + 99 others); Mon, 20 Jan 2020 10:39:44 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:33525 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726942AbgATPjn (ORCPT ); Mon, 20 Jan 2020 10:39:43 -0500 Received: from [5.158.153.53] (helo=tip-bot2.lab.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1itZ9I-0002jr-Mg; Mon, 20 Jan 2020 16:39:32 +0100 Received: from [127.0.1.1] (localhost [IPv6:::1]) by tip-bot2.lab.linutronix.de (Postfix) with ESMTP id 555BE1C1A41; Mon, 20 Jan 2020 16:39:32 +0100 (CET) Date: Mon, 20 Jan 2020 15:39:32 -0000 From: "tip-bot2 for Tony W Wang-oc" Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: x86/cpu] x86/cpu: Remove redundant cpu_detect_cache_sizes() call Cc: "Tony W Wang-oc" , Borislav Petkov , x86 , LKML In-Reply-To: <1579075257-6985-1-git-send-email-TonyWWang-oc@zhaoxin.com> References: <1579075257-6985-1-git-send-email-TonyWWang-oc@zhaoxin.com> MIME-Version: 1.0 Message-ID: <157953477207.396.16207362713509361883.tip-bot2@tip-bot2> X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the x86/cpu branch of tip: Commit-ID: 283bab9809786cf41798512f5c1e97f4b679ba96 Gitweb: https://git.kernel.org/tip/283bab9809786cf41798512f5c1e97f4b679ba96 Author: Tony W Wang-oc AuthorDate: Wed, 15 Jan 2020 16:00:57 +08:00 Committer: Borislav Petkov CommitterDate: Mon, 20 Jan 2020 16:32:35 +01:00 x86/cpu: Remove redundant cpu_detect_cache_sizes() call Both functions call init_intel_cacheinfo() which computes L2 and L3 cache sizes from CPUID(4). But then they also call cpu_detect_cache_sizes() a bit later which computes ->x86_tlbsize and L2 size from CPUID(80000006). However, the latter call is not needed because - on these CPUs, CPUID(80000006).EBX for ->x86_tlbsize is reserved - CPUID(80000006).ECX for the L2 size has the same result as CPUID(4) Therefore, remove the latter call to simplify the code. [ bp: Rewrite commit message. ] Signed-off-by: Tony W Wang-oc Signed-off-by: Borislav Petkov Link: https://lkml.kernel.org/r/1579075257-6985-1-git-send-email-TonyWWang-oc@zhaoxin.com --- arch/x86/kernel/cpu/centaur.c | 2 -- arch/x86/kernel/cpu/zhaoxin.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/arch/x86/kernel/cpu/centaur.c b/arch/x86/kernel/cpu/centaur.c index 02d99fe..4267925 100644 --- a/arch/x86/kernel/cpu/centaur.c +++ b/arch/x86/kernel/cpu/centaur.c @@ -64,8 +64,6 @@ static void init_c3(struct cpuinfo_x86 *c) c->x86_cache_alignment = c->x86_clflush_size * 2; set_cpu_cap(c, X86_FEATURE_REP_GOOD); } - - cpu_detect_cache_sizes(c); } enum { diff --git a/arch/x86/kernel/cpu/zhaoxin.c b/arch/x86/kernel/cpu/zhaoxin.c index 6b2d3b0..df1358b 100644 --- a/arch/x86/kernel/cpu/zhaoxin.c +++ b/arch/x86/kernel/cpu/zhaoxin.c @@ -51,8 +51,6 @@ static void init_zhaoxin_cap(struct cpuinfo_x86 *c) if (c->x86 >= 0x6) set_cpu_cap(c, X86_FEATURE_REP_GOOD); - - cpu_detect_cache_sizes(c); } static void early_init_zhaoxin(struct cpuinfo_x86 *c)