From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753819AbbEETup (ORCPT ); Tue, 5 May 2015 15:50:45 -0400 Received: from g4t3425.houston.hp.com ([15.201.208.53]:18140 "EHLO g4t3425.houston.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752278AbbEETum (ORCPT ); Tue, 5 May 2015 15:50:42 -0400 Message-ID: <1430854292.23761.284.camel@misato.fc.hp.com> Subject: Re: [PATCH v4 2/7] mtrr, x86: Fix MTRR lookup to handle inclusive entry From: Toshi Kani To: Borislav Petkov 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 Date: Tue, 05 May 2015 13:31:32 -0600 In-Reply-To: <20150505183947.GO3910@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> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2015-05-05 at 20:39 +0200, Borislav Petkov wrote: > On Tue, May 05, 2015 at 11:32:08AM -0600, Toshi Kani wrote: > > > Ok, I'm confused. Shouldn't the inclusive:1 case be > > > > > > (start:mtrr_start) (mtrr_start:mtrr_end) (mtrr_end:end) > > > > > > ? > > > > > > If so, this function would need more changes... > > > > Yes, that's how it gets separated eventually. Since *repeat is set in > > this case, the code only needs to separate the first part at a time. > > The 2nd part gets separated in the next call with the *repeat. > > Aah, right, the caller is supposed to adjust the interval limits on > subsequent calls. Please reflect this in the comment because: > > * (start:mtrr_start) (mtrr_start:end) > > is misleading for inclusive:1. 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) * depending on kind of overlap. * Return the type for first region and a pointer to * the start of second region so that caller will * lookup again on the second region. * Note: This way we handle multiple overlaps as well. */ Thanks, -Toshi