Re: [PATCH v1][CLEANUP] x86: use already defined macros instead of hard-coded values

From: Borislav Petkov
Date: Thu Mar 05 2015 - 13:19:17 EST


On Fri, Mar 06, 2015 at 12:12:09AM +0600, Alexander Kuleshov wrote:
> Ok, i looked on it with gdb, and X86_FEATURE_NX is not correct here.
> It's a bug number one.

Yes, X86_FEATURE_NX is not the same bit type as the bits you have in
%edi.

> And L3_START_KERNEL*8 + 1, must be L3_START_KERNEL*8 + 8, as we works
> with page entries
> or i'm wrong here?

Yes.

And look at the code after you've changed it. Do you think someone
looking at it a couple of months from now will know what

L3_START_KERNEL*8 + 8

or

(L3_START_KERNEL + 1)*8

means?

So having 510 and 511 to mean the last two page table entries is much
more understandable.

Like I told you a couple of days ago, please don't waste your time with
stuff which already works and there are no problems with and go look for
real bugs. Believe me, there are plenty out there.

> Anyway, thanks for education:)

No problem.

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.
--
--
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/