Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2273579imm; Thu, 27 Sep 2018 10:03:39 -0700 (PDT) X-Google-Smtp-Source: ACcGV61pRgbKMeklQdVjlIvoHx3hA7UPV+MUn8e0UFJ9NIVmGKbRfEnuFBnqzStRYPpLTV7eXXpi X-Received: by 2002:a17:902:7b83:: with SMTP id w3-v6mr12152691pll.285.1538067819069; Thu, 27 Sep 2018 10:03:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538067819; cv=none; d=google.com; s=arc-20160816; b=Nev0yN6QF6rxUOrEUxD+dsng2didsGcJyOu+nxDsh+/uId48YHmk97vGIKau5WYGfz UKWVGJbu+FOMK66amiMuvMokV6IfaXUYsXUwUzKYLSxJXu39joMu1Lj4F/2foRrtNdiT 1TcS2uHJPCzjg4vgAXKBIjLckbyKtonwwTyQivHQZf6Z0wp5x0N97+Mwo196jmWd9Ks7 YFVbZp8gu4C36Cdp1qQ6RMtT+rTshUQRirofoDDADwSHQxw3qr7F4b0HxSAV3+USp1u7 XF+CgvAzykMAbtbBdIZsuyGzz7DaQVqqzHDuN501+qX6XYh9nPMBZEAOE0h30kPiev5f bz6A== 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=pcBpUTyrLM5PaKcxaOaW+nVgcmPiJue0yraxEh5VxvQ=; b=Cto4jXyCzTC0T1Q0NJUeRo6VnKtbUpA2VsZY/3MfkQlzA/dxIGK6gPvDTLNk42Y6SU FkuZw5c2TQT9nwkCIBEi2ENVEGxrCh7gA3bkdUVnd1GCbP0MBqJhnVFAzVkHx6jJyRNz U/sjERoFv/Gu/Q1RZsiuBlt1pPOhlkqh0JLezZ8enO7SRlcY9HXN18aohDex9rhJd9Kc Ml0dEYlE8BVsKoj+3FI3ZUCMkdIbNlamXY8zJ633M6eGm96jm/scxMQmb1Kv3n6Is8Pu GAjB8X6PlLzoTgoRiAXLQMM2/Otbt/F30Gr1VXxaLHluKRYf4TteIcZMFVeZTBCXhTuO 62OA== 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 f8-v6si2318646plt.408.2018.09.27.10.03.23; Thu, 27 Sep 2018 10:03:39 -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 S1728515AbeI0XWD (ORCPT + 99 others); Thu, 27 Sep 2018 19:22:03 -0400 Received: from terminus.zytor.com ([198.137.202.136]:49181 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727338AbeI0XWD (ORCPT ); Thu, 27 Sep 2018 19:22:03 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w8RH2gX7099929 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 27 Sep 2018 10:02:42 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w8RH2gQl099926; Thu, 27 Sep 2018 10:02:42 -0700 Date: Thu, 27 Sep 2018 10:02:42 -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: bp@suse.de, tglx@linutronix.de, linux-kernel@vger.kernel.org, hpa@zytor.com, puwen@hygon.cn, mingo@kernel.org Reply-To: hpa@zytor.com, mingo@kernel.org, puwen@hygon.cn, linux-kernel@vger.kernel.org, tglx@linutronix.de, bp@suse.de In-Reply-To: <87000fa82e273f5967c908448414228faf61e077.1537533369.git.puwen@hygon.cn> References: <87000fa82e273f5967c908448414228faf61e077.1537533369.git.puwen@hygon.cn> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cpu] x86/smpboot: Do not use BSP INIT delay and MWAIT to idle on Dhyana Git-Commit-ID: 0b13bec787dccca96f8c431da732657ae01baf9a 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: 0b13bec787dccca96f8c431da732657ae01baf9a Gitweb: https://git.kernel.org/tip/0b13bec787dccca96f8c431da732657ae01baf9a Author: Pu Wen AuthorDate: Sun, 23 Sep 2018 17:34:32 +0800 Committer: Borislav Petkov CommitDate: Thu, 27 Sep 2018 18:28:57 +0200 x86/smpboot: Do not use BSP INIT delay and MWAIT to idle on Dhyana The Hygon Dhyana CPU uses no delay in smp_quirk_init_udelay(), and does HLT on idle just like AMD does. Signed-off-by: Pu Wen Signed-off-by: Borislav Petkov Reviewed-by: Borislav Petkov Cc: bp@alien8.de 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/87000fa82e273f5967c908448414228faf61e077.1537533369.git.puwen@hygon.cn --- arch/x86/kernel/smpboot.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index f02ecaf97904..5369d7fac797 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -676,6 +676,7 @@ static void __init smp_quirk_init_udelay(void) /* if modern processor, use no delay */ if (((boot_cpu_data.x86_vendor == X86_VENDOR_INTEL) && (boot_cpu_data.x86 == 6)) || + ((boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) && (boot_cpu_data.x86 >= 0x18)) || ((boot_cpu_data.x86_vendor == X86_VENDOR_AMD) && (boot_cpu_data.x86 >= 0xF))) { init_udelay = 0; return; @@ -1592,7 +1593,8 @@ static inline void mwait_play_dead(void) void *mwait_ptr; int i; - if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD || + boot_cpu_data.x86_vendor == X86_VENDOR_HYGON) return; if (!this_cpu_has(X86_FEATURE_MWAIT)) return;