From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753646AbbKXJfN (ORCPT ); Tue, 24 Nov 2015 04:35:13 -0500 Received: from terminus.zytor.com ([198.137.202.10]:55386 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752508AbbKXJfK (ORCPT ); Tue, 24 Nov 2015 04:35:10 -0500 Date: Tue, 24 Nov 2015 01:34:12 -0800 From: tip-bot for Juergen Gross Message-ID: Cc: tglx@linutronix.de, brgerst@gmail.com, jgross@suse.com, mingo@kernel.org, bp@suse.de, bp@alien8.de, linux-kernel@vger.kernel.org, peterz@infradead.org, luto@amacapital.net, hpa@zytor.com, dvlasenk@redhat.com, torvalds@linux-foundation.org Reply-To: dvlasenk@redhat.com, hpa@zytor.com, torvalds@linux-foundation.org, luto@amacapital.net, bp@suse.de, peterz@infradead.org, bp@alien8.de, linux-kernel@vger.kernel.org, tglx@linutronix.de, jgross@suse.com, mingo@kernel.org, brgerst@gmail.com In-Reply-To: <1448276364-31334-1-git-send-email-jgross@suse.com> References: <1448276364-31334-1-git-send-email-jgross@suse.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/apic] x86/apic: Fix the saving and restoring of lapic vectors during suspend/resume Git-Commit-ID: 42baa2581c92f8d07e7260506c8d41caf14b0fc3 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 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 42baa2581c92f8d07e7260506c8d41caf14b0fc3 Gitweb: http://git.kernel.org/tip/42baa2581c92f8d07e7260506c8d41caf14b0fc3 Author: Juergen Gross AuthorDate: Mon, 23 Nov 2015 11:59:24 +0100 Committer: Ingo Molnar CommitDate: Tue, 24 Nov 2015 09:18:33 +0100 x86/apic: Fix the saving and restoring of lapic vectors during suspend/resume Saving and restoring lapic vectors in lapic_suspend() and lapic_resume() is not consistent: the thmr vector saving is guarded by a different config option than the restore part. The cmci vector isn't handled at all. Those inconsistencies are not very critical, as the missing cmci vector will be set via mce resume handling, the wrong config option used for restoring the thmr vector can't be configured differently than the one which should be used. Nevertheless correct the thmr vector restore and add cmci vector handling. Signed-off-by: Juergen Gross Acked-by: Borislav Petkov Cc: Andy Lutomirski Cc: Borislav Petkov Cc: Brian Gerst Cc: Denys Vlasenko Cc: H. Peter Anvin Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Link: http://lkml.kernel.org/r/1448276364-31334-1-git-send-email-jgross@suse.com [ Minor code edits. ] Signed-off-by: Ingo Molnar --- arch/x86/kernel/apic/apic.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 2f69e3b..8d7df74 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -2270,6 +2270,7 @@ static struct { unsigned int apic_tmict; unsigned int apic_tdcr; unsigned int apic_thmr; + unsigned int apic_cmci; } apic_pm_state; static int lapic_suspend(void) @@ -2299,6 +2300,10 @@ static int lapic_suspend(void) if (maxlvt >= 5) apic_pm_state.apic_thmr = apic_read(APIC_LVTTHMR); #endif +#ifdef CONFIG_X86_MCE_INTEL + if (maxlvt >= 6) + apic_pm_state.apic_cmci = apic_read(APIC_LVTCMCI); +#endif local_irq_save(flags); disable_local_APIC(); @@ -2355,10 +2360,14 @@ static void lapic_resume(void) apic_write(APIC_SPIV, apic_pm_state.apic_spiv); apic_write(APIC_LVT0, apic_pm_state.apic_lvt0); apic_write(APIC_LVT1, apic_pm_state.apic_lvt1); -#if defined(CONFIG_X86_MCE_INTEL) +#ifdef CONFIG_X86_THERMAL_VECTOR if (maxlvt >= 5) apic_write(APIC_LVTTHMR, apic_pm_state.apic_thmr); #endif +#ifdef CONFIG_X86_MCE_INTEL + if (maxlvt >= 6) + apic_write(APIC_LVTCMCI, apic_pm_state.apic_cmci); +#endif if (maxlvt >= 4) apic_write(APIC_LVTPC, apic_pm_state.apic_lvtpc); apic_write(APIC_LVTT, apic_pm_state.apic_lvtt);