lkml.org 
[lkml]   [2023]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 1/1] x86/pti: Fix kernel warnings for pti= and nopti cmdline options.
From
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@intel.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


\
 
 \ /
  Last update: 2023-08-14 23:13    [W:2.295 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site