[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <841e08d9-ce97-e57a-3fc4-0fb87322903a@intel.com>
Date: Mon, 14 Aug 2023 14:12:17 -0700
From: Sohil Mehta <sohil.mehta@...el.com>
To: Jo Van Bulck <jo.vanbulck@...kuleuven.be>,
<linux-kernel@...r.kernel.org>, <dave.hansen@...ux.intel.com>,
<luto@...nel.org>, <peterz@...radead.org>, <mingo@...hat.com>
CC: <x86@...nel.org>, <bp@...en8.de>, <tglx@...utronix.de>,
<hpa@...or.com>
Subject: Re: [PATCH 1/1] x86/pti: Fix kernel warnings for pti= and nopti
cmdline options.
On 8/12/2023 8:54 AM, Jo Van Bulck wrote:
> arch/x86/mm/pti.c | 55 ++++++++++++++++++++++++-----------------------
> 1 file changed, 28 insertions(+), 27 deletions(-)
>
This version is very similar to the original patch and much simpler.
Sorry about the unnecessary churn.
Apart from the minor nits below,
Reviewed-by: Sohil Mehta <sohil.mehta@...el.com>
> + if (cpu_mitigations_off())
> pti_mode = PTI_FORCE_OFF;
> + if (pti_mode == PTI_FORCE_OFF) {
> pti_print_if_insecure("disabled on command line.");
> return;
> }
A new line here would be useful.
> + if (pti_mode == PTI_FORCE_ON) {
> + pti_print_if_secure("force enabled on command line.");
> + goto enable;
> + }
>
> -autosel:
> if (!boot_cpu_has_bug(X86_BUG_CPU_MELTDOWN))
> return;
> enable:
> setup_force_cpu_cap(X86_FEATURE_PTI);
> }
>
Was there an issue with the flow you had in the original patch? It was
avoiding the goto label and flow was a bit more linear.
> if (pti_mode == PTI_AUTO && !boot_cpu_has_bug(X86_BUG_CPU_MELTDOWN))
> return;
>
> if (pti_mode == PTI_FORCE_ON)
> pti_print_if_secure("force enabled on command line.");
>
> setup_force_cpu_cap(X86_FEATURE_PTI);
Sohil
Powered by blists - more mailing lists