Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2279070imm; Thu, 27 Sep 2018 10:08:17 -0700 (PDT) X-Google-Smtp-Source: ACcGV63YDEIZFMQKTKqXpVHS3t8W9yMDQoXIZk0ygTc/YmpkL/kbETvKGGa/4meVpx4PnxaaB4B9 X-Received: by 2002:a63:2541:: with SMTP id l62-v6mr1927985pgl.343.1538068096915; Thu, 27 Sep 2018 10:08:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538068096; cv=none; d=google.com; s=arc-20160816; b=NSx0M1ZiRlr3bTbrFTxcza5gKQ58QYCW2fEFzcPnYN+u8wuUHWfDeZ3hJRBr2XezMj qQ/VZdBFv8l/6gjPkuuot7DMNPw4u+VVRB8/89HKvpZUxp7jEHsfmt9/qlpv/Ksg0B1+ bTVR2gaT7HFtoprpB2/ZfZ/ovQPsYM8h6Jt24EciedoLP+TZG1/T6XPMBYZoGvXnS6dn 1HT9icCSgcOlRGbR7nOijOk6EmDcOLKiStZQYkH1koRW9MH7ijEHSu8UFQ/+KOh8r1cw HuBIZhkLEhZRSmx0n2hd/4K8xobzUekGlLIW+bFB5qplGL5WnkUnTlBeb0+G3CJbkQYC Hibw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date; bh=423rHa5pHfmqleP/t4xWRjYXOgDFnoPQYO8CStHqsnI=; b=nDj82La2Wqf5OYtB12lPhno0C+BENo5e7cvr8fVqRfURAvSxJICKyl3ngfkVnedztI dz6LMV8fIPO6ZKTQBg6IMz89r0WtPOSJ5CA+ylWJbjv1lS+SoHFsghjmC5q2GuWOf9pU JMZK/7HE25vEAwgJxx6DEitnB7v0qT6v37Y27ay3DcNLJXbrIl2yIWLlFZ9edckJdOJG ceu2KQ+tb9zxxapOtT9r5KUN0thbnYkETeJVGrMu5U0pdQ8RD2PsNIXoig/1hetJs0SU hIYTVxIZo8iYhA01DzhdClY1FdGy+B/1gJRVKiOP+yr766BckpITqq5pPO4KWj0B7jpb dboA== 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 b13-v6si2690657plm.275.2018.09.27.10.08.01; Thu, 27 Sep 2018 10:08:16 -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 S1728740AbeI0XZC (ORCPT + 99 others); Thu, 27 Sep 2018 19:25:02 -0400 Received: from terminus.zytor.com ([198.137.202.136]:57549 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728204AbeI0XZA (ORCPT ); Thu, 27 Sep 2018 19:25:00 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w8RH5Y8B101899 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 27 Sep 2018 10:05:34 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w8RH5YpU101896; Thu, 27 Sep 2018 10:05:34 -0700 Date: Thu, 27 Sep 2018 10:05:34 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Pu Wen Message-ID: Cc: puwen@hygon.cn, bp@suse.de, tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org, linux-kernel@vger.kernel.org Reply-To: hpa@zytor.com, bp@suse.de, tglx@linutronix.de, puwen@hygon.cn, mingo@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <7a557265a8c7c9e842fe60f9d8e064458801aef3.1537533369.git.puwen@hygon.cn> References: <7a557265a8c7c9e842fe60f9d8e064458801aef3.1537533369.git.puwen@hygon.cn> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cpu] x86/apic: Add Hygon Dhyana support Git-Commit-ID: da33dfef404174b0b452f4d2a9a9e00801794f3a X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-0.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, DATE_IN_FUTURE_24_48 autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: da33dfef404174b0b452f4d2a9a9e00801794f3a Gitweb: https://git.kernel.org/tip/da33dfef404174b0b452f4d2a9a9e00801794f3a Author: Pu Wen AuthorDate: Sun, 23 Sep 2018 17:35:28 +0800 Committer: Borislav Petkov CommitDate: Thu, 27 Sep 2018 18:28:58 +0200 x86/apic: Add Hygon Dhyana support Add Hygon Dhyana support to the APIC subsystem. When running in 32 bit mode, bigsmp should be enabled if there are more than 8 cores online. Signed-off-by: Pu Wen Signed-off-by: Borislav Petkov Reviewed-by: Borislav Petkov Cc: tglx@linutronix.de Cc: mingo@redhat.com Cc: hpa@zytor.com Cc: x86@kernel.org Cc: thomas.lendacky@amd.com Link: https://lkml.kernel.org/r/7a557265a8c7c9e842fe60f9d8e064458801aef3.1537533369.git.puwen@hygon.cn --- arch/x86/kernel/apic/apic.c | 7 +++++++ arch/x86/kernel/apic/probe_32.c | 1 + 2 files changed, 8 insertions(+) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 84132eddb5a8..ab731ab09f06 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -224,6 +224,11 @@ static int modern_apic(void) if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD && boot_cpu_data.x86 >= 0xf) return 1; + + /* Hygon systems use modern APIC */ + if (boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) + return 1; + return lapic_get_version() >= 0x14; } @@ -1912,6 +1917,8 @@ static int __init detect_init_APIC(void) (boot_cpu_data.x86 >= 15)) break; goto no_apic; + case X86_VENDOR_HYGON: + break; case X86_VENDOR_INTEL: if (boot_cpu_data.x86 == 6 || boot_cpu_data.x86 == 15 || (boot_cpu_data.x86 == 5 && boot_cpu_has(X86_FEATURE_APIC))) diff --git a/arch/x86/kernel/apic/probe_32.c b/arch/x86/kernel/apic/probe_32.c index 02e8acb134f8..47ff2976c292 100644 --- a/arch/x86/kernel/apic/probe_32.c +++ b/arch/x86/kernel/apic/probe_32.c @@ -185,6 +185,7 @@ void __init default_setup_apic_routing(void) break; } /* If P4 and above fall through */ + case X86_VENDOR_HYGON: case X86_VENDOR_AMD: def_to_bigsmp = 1; }