Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1031033AbbEEUJh (ORCPT ); Tue, 5 May 2015 16:09:37 -0400 Received: from mail.skyhub.de ([78.46.96.112]:35755 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1030943AbbEEUJe (ORCPT ); Tue, 5 May 2015 16:09:34 -0400 Date: Tue, 5 May 2015 22:09:31 +0200 From: Borislav Petkov 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 v4 2/7] mtrr, x86: Fix MTRR lookup to handle inclusive entry Message-ID: <20150505200931.GS3910@pd.tnic> References: <1427234921-19737-1-git-send-email-toshi.kani@hp.com> <1427234921-19737-3-git-send-email-toshi.kani@hp.com> <20150505171114.GM3910@pd.tnic> <1430847128.23761.276.camel@misato.fc.hp.com> <20150505183947.GO3910@pd.tnic> <1430854292.23761.284.camel@misato.fc.hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1430854292.23761.284.camel@misato.fc.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 Content-Length: 1618 Lines: 48 On Tue, May 05, 2015 at 01:31:32PM -0600, Toshi Kani wrote: > Well, the comment kinda says it already, but I will try to clarify it. > > /* > * We have start:end spanning across an MTRR. > * We split the region into either > * - start_state:1 > * (start:mtrr_end) (mtrr_end:end) > * - end_state:1 or inclusive:1 > * (start:mtrr_start) (mtrr_start:end) What I mean is this: * - start_state:1 * (start:mtrr_end) (mtrr_end:end) * - end_state:1 * (start:mtrr_start) (mtrr_start:end) * - inclusive:1 * (start:mtrr_start) (mtrr_start:mtrr_end) (mtrr_end:end) * * depending on kind of overlap. * * Return the type of the first region and a pointer to the start * of next region so that caller will be advised to lookup again * after having adjusted start and end. * * Note: This way we handle multiple overlaps as well. */ We add comments so that people can read them and can quickly understand what the function does. Not to make them parse it and wonder why inclusive:1 is listed together with end_state:1 which returns two intervals. Note that I changed the text to talk about the *next* region and not about the *second* region, to make it even more clear. -- Regards/Gruss, Boris. ECO tip #101: Trim your mails when you reply. -- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/