Re: [PATCH v10 10/12] x86, mm, pat: Cleanup init flags in pat_init()

From: Borislav Petkov
Date: Fri May 29 2015 - 04:59:39 EST


On Wed, May 27, 2015 at 09:19:02AM -0600, Toshi Kani wrote:
> pat_init() uses two flags, 'boot_cpu' and 'boot_pat_state', for
> tracking the boot CPU's initialization status. 'boot_pat_state'
> is also overloaded to carry the boot PAT value.
>
> This patch cleans this up by replacing them with a new single
> flag, 'boot_cpu_done', to track the boot CPU's initialization
> status. 'boot_pat_state' is only used to carry the boot PAT
> value as a result.
>
> Suggested-by: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
> Signed-off-by: Toshi Kani <toshi.kani@xxxxxx>
> ---
> arch/x86/mm/pat.c | 42 ++++++++++++++++++++----------------------
> 1 file changed, 20 insertions(+), 22 deletions(-)

...

> + rdmsrl(MSR_IA32_CR_PAT, boot_pat_state);
> + if (!boot_pat_state) {
> + pat_disable("PAT read returns always zero, disabled.");
> + return;
> + }
> + } else if (!cpu_has_pat) {
> + /*
> + * If this happens we are on a secondary CPU, but
> + * switched to PAT on the boot CPU. We have no way to
> + * undo PAT.
> + */
> + pr_err("PAT enabled, but not supported by secondary CPU\n");
> + BUG();

These could be replaced with a panic().

--
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/