Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1370773imm; Sun, 23 Sep 2018 02:37:55 -0700 (PDT) X-Google-Smtp-Source: ACcGV62wN2yhMj+jEaVI5uMq8DM97B7RMU5I+ZrT6w/a/u2KkB/wRnVBhl4t/5b+AugrHfZRF5xd X-Received: by 2002:a63:6781:: with SMTP id b123-v6mr5150385pgc.151.1537695475477; Sun, 23 Sep 2018 02:37:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537695475; cv=none; d=google.com; s=arc-20160816; b=DS4ZEvrIJjALg4FS70/3ZEpEMpgBE71YS2EUT6IFOZi+Ez0KdusvzFCCBOW6/hdCD6 3G6PK3i1BUNCiylRfP3UDN4m4sBr4EdNkm4YwNKpM7Yc82Zp8ImEoq8z4zd4CEMPbNHC nLLLZre9PCnbbgTZyNFyo1MExCWlAkbQxeRCZ++QWw5+ulQoxZZCzEipaYXidam50eiY BOExunqq50TikSoh42bl0bR3uM0n9bH6ulDm9mEqMHSyiDnAKOS9SmPnv6FoMkY1pu9s wWv56/595KIO+ZKxPMeYccGS7x+skiTmzOzZTHj+cHnEfWRfb3f2EbqzyDH/PG8s0/dD HadA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=gljCEA5YGFHx4b+I0um6VV6NBTkaCcYzNqL4FRHWN0c=; b=z9v01xXkhExonfELVY/g0gWt9z6jcUSAiwLJ9BMK3P0Fa6IOLbF7i74vWxQNnDtE/H 0XEkYqYRfOHlMj3cYdxt9xBQO+s03P8nviH0NGziLleIuWfJpj/usJHIUzNpgcKisY9F HETItFfnQGBceAjeNoHNCOurY8jHF954zkysq51PmHyLzbD4gUeHtbbEksezJp+rF3Jw MzgOW8ixS0O0nZKziFRuK+FAA4CKiidP4qRIpWTHYtKdxWEvlaRTooGVQBnvHixIQzmX aDSXDoMV2hwW4Wuc/C5dK9koOc0ActCk3FcJ8GKNzAXP9/PIt8FC0RzuaqBo9Q21wsKS +6Qg== 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 n17-v6si32790547pgh.501.2018.09.23.02.37.40; Sun, 23 Sep 2018 02:37:55 -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 S1726744AbeIWPch (ORCPT + 99 others); Sun, 23 Sep 2018 11:32:37 -0400 Received: from smtp21.cstnet.cn ([159.226.251.21]:48640 "EHLO cstnet.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726052AbeIWPch (ORCPT ); Sun, 23 Sep 2018 11:32:37 -0400 Received: from pw-vbox.higon.com (unknown [182.150.46.145]) by APP-01 (Coremail) with SMTP id qwCowACX+UZhXqdbJEqzDA--.31S2; Sun, 23 Sep 2018 17:35:37 +0800 (CST) From: Pu Wen To: bp@alien8.de, tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, thomas.lendacky@amd.com Cc: linux-kernel@vger.kernel.org, linux-arch@vger.kernel.org, Pu Wen Subject: [PATCH v8 08/16] x86/apic: Add Hygon Dhyana support to APIC Date: Sun, 23 Sep 2018 17:35:28 +0800 Message-Id: <7a557265a8c7c9e842fe60f9d8e064458801aef3.1537533369.git.puwen@hygon.cn> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: X-CM-TRANSID: qwCowACX+UZhXqdbJEq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03qof0z/ Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add Hygon Dhyana support to the APIC subsystem as it uses modern APIC. When running on 32 bit mode, bigsmp should be enabled if there are more than 8 cores online. Signed-off-by: Pu Wen Reviewed-by: Borislav Petkov --- 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 84132ed..ab731ab 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 02e8acb..47ff297 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; } -- 2.7.4