[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120829213246.GE31869@aftab.osrc.amd.com>
Date: Wed, 29 Aug 2012 23:32:46 +0200
From: Borislav Petkov <bp@...64.org>
To: Yinghai Lu <yinghai@...nel.org>
Cc: Jacob Shin <jacob.shin@....com>, X86-ML <x86@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
"H. Peter Anvin" <hpa@...or.com>, Tejun Heo <tj@...nel.org>,
Dave Young <dyoung@...hat.com>,
Chao Wang <chaowang@...hat.com>,
Vivek Goyal <vgoyal@...hat.com>,
Andreas Herrmann <andreas.herrmann3@....com>
Subject: Re: [PATCH 4/6] x86: Only direct map addresses that are marked as
E820_RAM
On Wed, Aug 29, 2012 at 02:17:51PM -0700, Yinghai Lu wrote:
> > +struct range pfn_mapped[E820_X_MAX];
> > +int nr_pfn_mapped;
>
> change to static?
>
> > +
> > +void add_pfn_range_mapped(unsigned long start_pfn, unsigned long end_pfn)
> > +{
> > + nr_pfn_mapped = add_range_with_merge(pfn_mapped, E820_X_MAX,
> > + nr_pfn_mapped, start_pfn, end_pfn);
> > + nr_pfn_mapped = clean_sort_range(pfn_mapped, E820_X_MAX);
> > +
> > + max_pfn_mapped = max(max_pfn_mapped, end_pfn);
> > +
> > + if (end_pfn <= (1UL << (32 - PAGE_SHIFT)))
> > + max_low_pfn_mapped = max(max_low_pfn_mapped, end_pfn);
> > +}
> > +
> > +bool pfn_range_is_mapped(unsigned long start_pfn, unsigned long end_pfn)
> > +{
> > + int i;
> > +
> > + for (i = 0; i < nr_pfn_mapped; i++)
> > + if ((start_pfn >= pfn_mapped[i].start) &&
> > + (end_pfn <= pfn_mapped[i].end))
> > + return true;
> > +
> > + return false;
> > +}
> > +
> > +bool pfn_is_mapped(unsigned long pfn)
> > +{
> > + return pfn_range_is_mapped(pfn, pfn + 1);
> > +}
>
> wonder if those functions have to be in arch/x86/kernel/setup.c.
>
> also do we need to update the tracking array when we have do memory hot-remove?
Would you please make sure you've reviewed this whole patchset
thoroughly so that Jacob can do all changes at once and not keep
resending them twice a week.
Thanks a lot!
--
Regards/Gruss,
Boris.
Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551
--
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