Re: [PATCH v4 2/7] mtrr, x86: Fix MTRR lookup to handle inclusive entry

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, May 05, 2015 at 01:31:32PM -0600, Toshi Kani wrote:
> Well, the comment kinda says it already, but I will try to clarify it.
> 
>            /*
>             * We have start:end spanning across an MTRR.
>             * We split the region into either
>             * - start_state:1
>             *     (start:mtrr_end) (mtrr_end:end)
>             * - end_state:1 or inclusive:1
>             *     (start:mtrr_start) (mtrr_start:end)

What I mean is this:

		* - start_state:1
		*     (start:mtrr_end) (mtrr_end:end)
		* - end_state:1
		*     (start:mtrr_start) (mtrr_start:end)
		* - inclusive:1
		*     (start:mtrr_start) (mtrr_start:mtrr_end) (mtrr_end:end)
		*
		* depending on kind of overlap.
		*
		* Return the type of the first region and a pointer to the start
		* of next region so that caller will be advised to lookup again
		* after having adjusted start and end.
		*
		* Note: This way we handle multiple overlaps as well.
		*/

We add comments so that people can read them and can quickly understand
what the function does. Not to make them parse it and wonder why
inclusive:1 is listed together with end_state:1 which returns two
intervals.

Note that I changed the text to talk about the *next* region and not
about the *second* region, to make it even more clear.

-- 
Regards/Gruss,
    Boris.

ECO tip #101: Trim your mails when you reply.
--

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]