mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Sohil Mehta <sohil.mehta@intel.com>
To: Jo Van Bulck <jo.vanbulck@cs.kuleuven.be>,
	<linux-kernel@vger.kernel.org>, <dave.hansen@linux.intel.com>,
	<luto@kernel.org>, <peterz@infradead.org>, <mingo@redhat.com>
Cc: <x86@kernel.org>, <bp@alien8.de>, <tglx@linutronix.de>, <hpa@zytor.com>
Subject: Re: [PATCH 1/1] x86/pti: Fix kernel warnings for pti= and nopti cmdline options.
Date: Mon, 14 Aug 2023 14:12:17 -0700	[thread overview]
Message-ID: <841e08d9-ce97-e57a-3fc4-0fb87322903a@intel.com> (raw)
In-Reply-To: <20230812155448.8865-2-jo.vanbulck@cs.kuleuven.be>

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



  reply	other threads:[~2023-08-14 21:13 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-12 15:54 [PATCH v2 0/1] " Jo Van Bulck
2023-08-12 15:54 ` [PATCH 1/1] " Jo Van Bulck
2023-08-14 21:12   ` Sohil Mehta [this message]
2023-08-18 22:33     ` Jo Van Bulck
2023-08-14 20:43 ` [PATCH v2 0/1] " Sohil Mehta
2023-08-18 22:34   ` Jo Van Bulck
  -- strict thread matches above, loose matches on Subject: below --
2023-08-11 21:36 [PATCH v2 0/1] x86/pti: Fix kernel warnings for pti= and nopti cmdline Jo Van Bulck
2023-08-11 21:36 ` [PATCH 1/1] x86/pti: Fix kernel warnings for pti= and nopti cmdline options Jo Van Bulck
2023-08-11 23:27   ` Jo Van Bulck
2023-08-11 23:42     ` Dave Hansen
2023-08-11 23:58       ` Sohil Mehta
2023-08-12  0:08         ` Dave Hansen
2023-08-12  0:15           ` Sohil Mehta
2023-08-12 15:53           ` Jo Van Bulck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=841e08d9-ce97-e57a-3fc4-0fb87322903a@intel.com \
    --to=sohil.mehta@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jo.vanbulck@cs.kuleuven.be \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®