Re: [PATCH][Regression] x86, 32-bit: trim memory not covered by wb mtrrs - FIX

From: Balaji Rao
Date: Thu Feb 07 2008 - 06:40:33 EST


On Thursday 07 February 2008 02:20:35 pm Yinghai Lu wrote:
<snip>
> > Cool! Yes, Yinghai Lu's patch indeed is the same as mine and its really
> > surprising that we've used the same variable name too! :)
>
> minor difference
> + trim_start = highest_pfn << PAGE_SHIFT;
> + trim_size = end_pfn << PAGE_SHIFT;
>
> could cause some problem with 32 bit kernel when mem > 4g.
> becase highest_pfn and end_pfn is unsigned long aka 32 bit ...could
> overflow.
>
> so need to assign thtem to trim_start/trim_end at first
> or
> + trim_start = (u64)highest_pfn << PAGE_SHIFT;
> + trim_size = (u64)end_pfn << PAGE_SHIFT;
>

Yea right.. Thanks for pointing that out.

--
regards,
balaji rao
--
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/