From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752569AbbCPHvs (ORCPT ); Mon, 16 Mar 2015 03:51:48 -0400 Received: from mail-wg0-f45.google.com ([74.125.82.45]:34391 "EHLO mail-wg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751047AbbCPHvq (ORCPT ); Mon, 16 Mar 2015 03:51:46 -0400 Date: Mon, 16 Mar 2015 08:51:39 +0100 From: Ingo Molnar To: Toshi Kani Cc: akpm@linux-foundation.org, hpa@zytor.com, tglx@linutronix.de, mingo@redhat.com, linux-mm@kvack.org, x86@kernel.org, linux-kernel@vger.kernel.org, dave.hansen@intel.com, Elliott@hp.com, pebolle@tiscali.nl Subject: Re: [PATCH v3 3/5] mtrr, x86: Fix MTRR state checks in mtrr_type_lookup() Message-ID: <20150316075139.GB15955@gmail.com> References: <1426282421-25385-1-git-send-email-toshi.kani@hp.com> <1426282421-25385-4-git-send-email-toshi.kani@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1426282421-25385-4-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 * Toshi Kani wrote: > 'mtrr_state.enabled' contains FE (fixed MTRRs enabled) and > E (MTRRs enabled) flags in MSR_MTRRdefType. Intel SDM, > section 11.11.2.1, defines these flags as follows: > - All MTRRs are disabled when the E flag is clear. > The FE flag has no affect when the E flag is clear. > - The default type is enabled when the E flag is set. > - MTRR variable ranges are enabled when the E flag is set. > - MTRR fixed ranges are enabled when both E and FE flags > are set. > > MTRR state checks in __mtrr_type_lookup() do not follow the > SDM definitions. Therefore, this patch fixes the MTRR state > checks according to the SDM. This patch defines the flags > in mtrr_state.enabled as follows. print_mtrr_state() is also > updated. > - FE flag: MTRR_STATE_MTRR_FIXED_ENABLED > - E flag: MTRR_STATE_MTRR_ENABLED > > Lastly, this patch fixes the 'else if (start < 0x1000000)', > which checks a fixed range but has an extra-zero in the > address, to 'else' with no condition. Firstly, this does multiple bug fixes in a single patch, which is a no-no: please split it up into separate patches. Secondly, please also outline the differences between the old code and the new code - don't just list the SDM logic and state that we are updating to it. Thanks, Ingo