[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150511201827.GI15636@pd.tnic>
Date: Mon, 11 May 2015 22:18:27 +0200
From: Borislav Petkov <bp@...en8.de>
To: Toshi Kani <toshi.kani@...com>
Cc: akpm@...ux-foundation.org, hpa@...or.com, tglx@...utronix.de,
mingo@...hat.com, linux-mm@...ck.org, x86@...nel.org,
linux-kernel@...r.kernel.org, dave.hansen@...el.com,
Elliott@...com, pebolle@...cali.nl
Subject: Re: [PATCH v4 7/7] mtrr, mm, x86: Enhance MTRR checks for KVA huge
page mapping
On Mon, May 11, 2015 at 01:25:16PM -0600, Toshi Kani wrote:
> > > @@ -235,13 +240,19 @@ static u8 mtrr_type_lookup_variable(u64 start, u64 end, u64 *partial_end,
> > > * Return Values:
> > > * MTRR_TYPE_(type) - The effective MTRR type for the region
> > > * MTRR_TYPE_INVALID - MTRR is disabled
> > > + *
> > > + * Output Argument:
> > > + * uniform - Set to 1 when MTRR covers the region uniformly, i.e. the region
> > > + * is fully covered by a single MTRR entry or the default type.
> >
> > I'd call this "single_mtrr". "uniform" could also mean that the resulting
> > type is uniform, i.e. of the same type but spanning multiple MTRRs.
>
> Actually, that is the intend of "uniform" and the same type but spanning
> multiple MTRRs should set "uniform" to 1. The patch does not check such
So why does it say "is fully covered by a single MTRR entry or the
default type." - the stress being on *single*
You need to make up your mind.
> We need to set "uniform" to 1 when MTRRs are disabled since there is no
> type conflict with MTRRs.
No, this is wrong.
When we return an *error*, "uniform" should be *undefined* because MTRRs
are disabled and callers should be checking whether it returned an error
first and only *then* look at uniform.
> The warning was suggested by reviewers in the previous review so that
> driver writers will notice the issue.
No, we don't flood dmesg so that driver writers notice stuff. We better
fix the callers.
> Returning 0 here will lead
> ioremap() to use 4KB mappings, but does not cause ioremap() to fail.
I guess a pr_warn_once() should be better then. Flooding dmesg with
error messages for which the user can't really do anything about doesn't
bring us anything.
--
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@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists