Received: by 10.192.165.148 with SMTP id m20csp4144729imm; Mon, 30 Apr 2018 12:35:40 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqkmP4dddCmdpKegJ+s46ICXjNa/YwC8mZ+FDfIVwkjo6q40pKeZ7KRQFpqLV7S1i3gIeUe X-Received: by 2002:a17:902:9002:: with SMTP id a2-v6mr3703520plp.130.1525116940731; Mon, 30 Apr 2018 12:35:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525116940; cv=none; d=google.com; s=arc-20160816; b=ThVSiAT4XQ7T4NRanapnpX0NYFx8E7JyX6Gxx48L6uHOSx5gVISuQ9sxbXbW6t4eF/ +cFQr1KoIp7TB8roqksXQuZMWFijh3YDLCu+dKDYqDqiD5CSd3Yy/9BtqoYS5jdRcE/N vnDtVtxBiqnYPFqaNdPoUllOYb9hXbDoGVgXc/9eiSp30BnZ09QH3TOtPiwNPeo6OpL1 s0VmqkPXDusVVZ+MudwtxovTQXg9/kCwYmLJOnWJn19IYtEHhzZfVuZWYZ+0jGzD4YLf 5WvQZtU6kz7dlDF+IYGQqHIwRmI7JfQWApgF5fzz2T936RIIOTUWxmd76HyXXu5mRaWq 0E1Q== 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=TcUkpkahmBmxeNOXpX1ki5myqWzJFwPkW2h5D1R7JM4=; b=DDGNM2Mqpmk4Lx29QEB6TIjlq9pcOk+dlve7VftTOLCW9RH1e01xaODslAN0GVt6w5 RFri6xTAt5Pjox7eBPCDDTh0ZpkLfZQmJtr42YWE8cBtrJQ4jgmn0V4EexvHSJ0TFPUd Dln8TnZYyTxoyoCgaqaIh8ufah/FGoH5oGHpRHqEFjOf+1+wf2nO8X5FjitzGvA5jrtI tnTaI9jH3GnJLlReuamEzgA/jUqM9/Rup/XiGZTeBhHyQ4TZfaN+SRt63LdP0wG139f1 4xSnc9LkdIJZ+ft5+hrCb+V8xN08bd5pODFLgVDMvQXDvK+UaBoB1OwcNT8vsVlk9jSx jx+Q== 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 d65si8179925pfa.263.2018.04.30.12.35.26; Mon, 30 Apr 2018 12:35:40 -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 S1756513AbeD3Tda (ORCPT + 99 others); Mon, 30 Apr 2018 15:33:30 -0400 Received: from mail.kernel.org ([198.145.29.99]:37068 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932380AbeD3T2z (ORCPT ); Mon, 30 Apr 2018 15:28:55 -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 D350922DAC; Mon, 30 Apr 2018 19:28:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D350922DAC 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.16 108/113] x86/smpboot: Dont use mwait_play_dead() on AMD systems Date: Mon, 30 Apr 2018 12:25:19 -0700 Message-Id: <20180430184019.766115001@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180430184015.043892819@linuxfoundation.org> References: <20180430184015.043892819@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.16-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 @@ -1536,6 +1536,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))