Re: [PATCH 1/1] x86/pti: Fix kernel warnings for pti= and nopti cmdline options.

From: Jo Van Bulck
Date: Sat Aug 19 2023 - 04:10:19 EST


On 14.08.23 14:12, Sohil Mehta wrote:
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@xxxxxxxxx>

No problem, thanks for the help!


+ 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.

Added in next revision.

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.

No, the original flow also works and I agree that an explicit PTI_AUTO check may indeed be preferable. Reverting this in the next patch iteration.

Best,
Jo