Re: [PATCH 6/7] x86: pat.c introduce function to check for conflictswith existing memtypes

From: Brice Goglin
Date: Sat Jun 21 2008 - 02:21:09 EST


Andreas Herrmann wrote:
> ... to strip down loop body in reserve_memtype.
>
> Signed-off-by: Andreas Herrmann <andreas.herrmann3@xxxxxxx>
> ---
> arch/x86/mm/pat.c | 96 ++++++++++++++++++----------------------------------
> 1 files changed, 33 insertions(+), 63 deletions(-)
>
> diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c
> index 49dcd96..281ac64 100644
> --- a/arch/x86/mm/pat.c
> +++ b/arch/x86/mm/pat.c
> @@ -178,6 +178,33 @@ static unsigned long pat_x_mtrr_type(u64 start, u64 end, unsigned long req_type)
> return req_type;
> }
>
> +static int chk_conflict(struct memtype *new, struct memtype *entry,
> + unsigned long *type)
>

Looking at this, I thought it may be nice to add (and export to modules)
a function that checks whether a range of memory has some page attribute
applied, namely WC. The idea would be to help drivers call mtrr_add only
if ioremap_wc failed to setup WC. I am not sure it would work but it may
be easier than adding mtrr_add into ioremap_wc() as proposed in
http://lkml.org/lkml/2008/5/31/252

Brice

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/