From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755732AbbE2I7f (ORCPT ); Fri, 29 May 2015 04:59:35 -0400 Received: from mail.skyhub.de ([78.46.96.112]:54259 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755510AbbE2I7c (ORCPT ); Fri, 29 May 2015 04:59:32 -0400 Date: Fri, 29 May 2015 10:59:20 +0200 From: Borislav Petkov To: Toshi Kani Cc: hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, akpm@linux-foundation.org, arnd@arndb.de, linux-mm@kvack.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-nvdimm@ml01.01.org, jgross@suse.com, stefan.bader@canonical.com, luto@amacapital.net, hmh@hmh.eng.br, yigal@plexistor.com, konrad.wilk@oracle.com, Elliott@hp.com, mcgrof@suse.com, hch@lst.de Subject: Re: [PATCH v10 10/12] x86, mm, pat: Cleanup init flags in pat_init() Message-ID: <20150529085920.GB31435@pd.tnic> References: <1432739944-22633-1-git-send-email-toshi.kani@hp.com> <1432739944-22633-11-git-send-email-toshi.kani@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1432739944-22633-11-git-send-email-toshi.kani@hp.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 27, 2015 at 09:19:02AM -0600, Toshi Kani wrote: > pat_init() uses two flags, 'boot_cpu' and 'boot_pat_state', for > tracking the boot CPU's initialization status. 'boot_pat_state' > is also overloaded to carry the boot PAT value. > > This patch cleans this up by replacing them with a new single > flag, 'boot_cpu_done', to track the boot CPU's initialization > status. 'boot_pat_state' is only used to carry the boot PAT > value as a result. > > Suggested-by: Thomas Gleixner > Signed-off-by: Toshi Kani > --- > arch/x86/mm/pat.c | 42 ++++++++++++++++++++---------------------- > 1 file changed, 20 insertions(+), 22 deletions(-) ... > + rdmsrl(MSR_IA32_CR_PAT, boot_pat_state); > + if (!boot_pat_state) { > + pat_disable("PAT read returns always zero, disabled."); > + return; > + } > + } else if (!cpu_has_pat) { > + /* > + * If this happens we are on a secondary CPU, but > + * switched to PAT on the boot CPU. We have no way to > + * undo PAT. > + */ > + pr_err("PAT enabled, but not supported by secondary CPU\n"); > + BUG(); These could be replaced with a panic(). -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. --