Received: by 10.192.165.148 with SMTP id m20csp4165797imm; Mon, 30 Apr 2018 13:02:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq+zaR3qC2D+dbZs9kXkz169F7nrg0DkjXzXSboRCFFm7TlPTHuJ3uTrLAW3JEH1QGaCmiY X-Received: by 2002:a63:ae06:: with SMTP id q6-v6mr10940228pgf.350.1525118528722; Mon, 30 Apr 2018 13:02:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525118528; cv=none; d=google.com; s=arc-20160816; b=frvwN582Jr2z6unyc6XYDZgpd+Znhk+WvjjY/nBHmBcLtftqJCVssYYct3Ogkwt3Cq AsjwOjCHjNVele7l4ZAXQKKG0yQyMtBioc3A0iq0iKK3LCplCo8E1KXq9BKwqEYnd4KJ tuAK7VX8uQ+e0aRNIQ06ckpFuD3o2/fmJ6bvH4L0RUZmEZR7OJ8f8NbfbyYY8zEmVGpl k1vFMgX85leCMd3P1pNNpqtnNZ8eN6opKde6EH+LCyPxF8MylYlJFzt+Zce/Pj7UG/SA gTd7rSK3QeSBZUDtIB3Sew1xdw3ErCUt/nCz6nWEMFQQcLxa7h1J4AhniK3SWqKih3ve zfwQ== 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=4BCaLsfBnHLfGsC2Jwjf55gMHCvqdKzPdCgnZ2HOCRg=; b=dhGZXLs36cynnL2tAXQ44ZjFZXej/vhnfCIPgadrP7bJ52g15nu+kFv6bMzzrZfxgs FX+QOGdwy75o/xoVP/0vH0IYChn+9UKdAsFZiCJ0B6VppiKWck8TAjhi7jSMcwHz9jOo LuNJhELIccniQxMLMprrPA+w1jakJYidRihNy9wcc2NVXBEPJmZrgn4AJjS/34D+0BmF inqcKvCMhcB9tDB84bA5yNpuuFbpq9N1MGBq1/rTjxAHf2wWxys6bYsAsKOsuXli7zMR kxelWBDvL2nGW42mlSLhXhFunJWhIi9lCxXGD4QG7F/J13VK3Syu5YJlcu+Ie+gIc/sE 4L6A== 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 f16si8175117pfe.291.2018.04.30.13.01.54; Mon, 30 Apr 2018 13:02:08 -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 S1756120AbeD3UAh (ORCPT + 99 others); Mon, 30 Apr 2018 16:00:37 -0400 Received: from mail.kernel.org ([198.145.29.99]:34608 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932227AbeD3T1n (ORCPT ); Mon, 30 Apr 2018 15:27:43 -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 D86A222DCC; Mon, 30 Apr 2018 19:27:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D86A222DCC 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.14 85/91] x86/smpboot: Dont use mwait_play_dead() on AMD systems Date: Mon, 30 Apr 2018 12:25:07 -0700 Message-Id: <20180430184008.726821539@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184004.216234025@linuxfoundation.org> References: <20180430184004.216234025@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.14-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 @@ -1613,6 +1613,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))