Received: by 10.192.165.148 with SMTP id m20csp4181780imm; Mon, 30 Apr 2018 13:20:54 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrTC70oeLNpngelkh0biB5SGQwHGYxFUjQsa6sVVpg4ALMXYduVZ00Eqw7b1kZr3AN9VHB/ X-Received: by 2002:a17:902:d88a:: with SMTP id b10-v6mr7916508plz.220.1525119654282; Mon, 30 Apr 2018 13:20:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525119654; cv=none; d=google.com; s=arc-20160816; b=F9+rTrPUAbWg94y4xuAxzq1lSO/sMoxVe5A9Sawl1J0Zg9/wkcHTgloDTm3cE0pk1J YtsCIRosjesZ85X6Hy6i4EsRkMocQeFly38O+TKv5+hbmFK2dPex/TbvXoobPAdn/OL4 Abo+XU62IgtXLDTCvM+tlZvGL8bBKMFuQaxmCXr3/c0rz461ibPRJ/9K3k+Pun9IXRg0 NnXlBGg4A84JTkVZGLF7li5qtu6yiUudRojTv9KsyFVbf+uiZAZRBcMz4b+kqWT6m5cQ Krp6fFAIv/excWupvioNQQmqU8yPihteyqCm79DxMPGIfx8L40qLmGGEDPuoLHJxhKu3 sdog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=H/EgJzDNcUZ4cPK6rZIEwQOeDwn/Roqh2oEw5A1wWVs=; b=e4uJZxvIBeMoocpad7J8XRZ4omAEj4H/WcUUWT69A1OQrUSbV7HfhdtFlC0XDd1XMI UaLIsO0cyv71TRyOi+BO0UcwCBIg0DPKcIVQ5JNp2JgobiIYUKszIc8/5IFIDXexF1Pw bPE+uZL3Zk5HxDwVbHdAfPSnA4t6sbqBbtbSLvPVCQ/p00XAQj9tqH2N4rw1rjR2BEo8 tzHq3tHQfb0fP6haBS4J8anbKaEqI/0lqAfVqbEd2eBDCwtrpISuKepIo1Sf0zGJjiyH Ni3mzAlHmD0z7wolbfwArpTtkoKG/gaMgKzYSVk5HWpQ1iGa8KL7HZZI5FKezm4v4QSk /4Cw== 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 j123si8493103pfd.207.2018.04.30.13.20.40; Mon, 30 Apr 2018 13:20:54 -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 S1756065AbeD3UUG (ORCPT + 99 others); Mon, 30 Apr 2018 16:20:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:60692 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755777AbeD3T0r (ORCPT ); Mon, 30 Apr 2018 15:26:47 -0400 Received: from localhost (unknown [104.132.1.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4D78A22DCB; Mon, 30 Apr 2018 19:26:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4D78A22DCB Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Yazen Ghannam , Thomas Gleixner , Borislav Petkov , Yazen Ghannam Subject: [PATCH 4.9 59/61] x86/smpboot: Dont use mwait_play_dead() on AMD systems Date: Mon, 30 Apr 2018 12:25:02 -0700 Message-Id: <20180430183956.262525567@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430183951.312721450@linuxfoundation.org> References: <20180430183951.312721450@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Yazen Ghannam commit da6fa7ef67f07108a1b0cb9fd9e7fcaabd39c051 upstream. Recent AMD systems support using MWAIT for C1 state. However, MWAIT will not allow deeper cstates than C1 on current systems. play_dead() expects to use the deepest state available. The deepest state available on AMD systems is reached through SystemIO or HALT. If MWAIT is available, it is preferred over the other methods, so the CPU never reaches the deepest possible state. Don't try to use MWAIT to play_dead() on AMD systems. Instead, use CPUIDLE to enter the deepest state advertised by firmware. If CPUIDLE is not available then fallback to HALT. Signed-off-by: Yazen Ghannam Signed-off-by: Thomas Gleixner Reviewed-by: Borislav Petkov Cc: stable@vger.kernel.org Cc: Yazen Ghannam Link: https://lkml.kernel.org/r/20180403140228.58540-1-Yazen.Ghannam@amd.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/smpboot.c | 2 ++ 1 file changed, 2 insertions(+) --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c @@ -1591,6 +1591,8 @@ static inline void mwait_play_dead(void) void *mwait_ptr; int i; + if (boot_cpu_data.x86_vendor == X86_VENDOR_AMD) + return; if (!this_cpu_has(X86_FEATURE_MWAIT)) return; if (!this_cpu_has(X86_FEATURE_CLFLUSH))