Messages in this thread | | | Subject | Re: [PATCH 4/6] x86: Only direct map addresses that are marked as E820_RAM | From | "H. Peter Anvin" <> | Date | Wed, 29 Aug 2012 23:28:16 -0700 |
| |
This week is Kernel Summit & Plumbers... people are kind of distracted.
Borislav Petkov <bp@amd64.org> wrote:
>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
-- Sent from my mobile phone. Please excuse brevity and lack of formatting.
| |