Received: by 10.192.165.148 with SMTP id m20csp4191228imm; Mon, 30 Apr 2018 13:32:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZp2uVnQnc7w6RmWezFeO96o7nL8s51ST0pJryIkuQDiPKb0G6qJwETxe4qW8U9SAN8dsOLX X-Received: by 2002:a17:902:a704:: with SMTP id w4-v6mr13580918plq.5.1525120349148; Mon, 30 Apr 2018 13:32:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525120349; cv=none; d=google.com; s=arc-20160816; b=BVic/45+QVYMZbUNV9X9INkw5Sj40HQP3w6fx+zUWhj+tE16ZEnuCPHHhTZBVVDoOU cxb4PZh7fAuxyt5RRXd3+COVIMHG9y4eLGTnQ6XgjGaknIvMTIpFMxBMjhFuwqrzp8wW zstVuq9VBWuYbVRXmUQISGJepUVfh3rTtLjYbviFgtOBlhx1qCYJA0LezXRyOCVWK1Sb qMY5EbX5ZnCGLEf+tNfzg/UrYAHPCcXgqz+243VC832mse4mfBepuxlH/r5pvVcWVQns s1V2JWfLht4lxG7IwSFuzEJ14IRU3/hDZULbURx/jKrdsgmBjgu2TVYHo8y4IQNQHp8U s9Cg== 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=+cqqRqnAmt42Yo7pJWUROHFnvb53JS3WNP+2HV2Wwpo=; b=qFdwL2hDuvh7sM2S37CGfr/3rdAlGoZ6TAavfRWfuT0YZBhZYxhw0+ThgV430xfQDo vz8vrs9Ig8+HROhC0ncRh9a8aY3N4XW6uQ40XxaUe+2ZJ6kabaw8xzqKH0OHUuh2qP3y QSFVyGn6HpEPRFl4TQftlvniFo8cPbsJhDNR1H8Yb4GeiYhwdklB37hbwS1DPjoJAB++ 9yXnfZhvFbNR/kGBUPFRbmEdboXR6eKOjH1qoeMf3zNP7KZz3Iy4cot5PZM9Et/JYef7 LdgaFBn718DXcL/kgtKM8DxkP8eN6i9kiUdeH8DmAeiZY9Kqk8kCqQJt1IGT/5dyqv4F ISmA== 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 g9-v6si6520924pgo.214.2018.04.30.13.32.14; Mon, 30 Apr 2018 13:32:29 -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 S1755523AbeD3T0J (ORCPT + 99 others); Mon, 30 Apr 2018 15:26:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:59250 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755499AbeD3T0G (ORCPT ); Mon, 30 Apr 2018 15:26:06 -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 AC03622DAC; Mon, 30 Apr 2018 19:26:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC03622DAC 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.4 41/44] x86/smpboot: Dont use mwait_play_dead() on AMD systems Date: Mon, 30 Apr 2018 12:24:52 -0700 Message-Id: <20180430190947.967684398@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430190946.093694747@linuxfoundation.org> References: <20180430190946.093694747@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.4-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 @@ -1442,6 +1442,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))