public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Daniel Sneddon <daniel.sneddon@linux.intel.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, hpa@zytor.com, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, pawan.kumar.gupta@linux.intel.com
Subject: Re: [PATCH 2/2] x86/bugs: Clean-up verw mitigations
Date: Tue, 29 Oct 2024 07:40:28 -0700	[thread overview]
Message-ID: <c5fa82d7-e5e9-4612-a238-3c58152c40d0@linux.intel.com> (raw)
In-Reply-To: <20241029113702.GUZyDI3u_6IxiCWOBJ@fat_crate.local>

On 10/29/24 04:37, Borislav Petkov wrote:
> On Mon, Oct 28, 2024 at 04:50:35PM -0700, Daniel Sneddon wrote:
>> @@ -599,20 +503,70 @@ static void __init verw_mitigations_check(void)
>>  	}
>>  }
>>  
>> -static void __init md_clear_select_mitigation(void)
>> +static bool __init verw_mitigations_disabled(void)
>>  {
>>  	verw_mitigations_check();
>> +	/*
>> +	 * TODO: Create a single mitigation variable that will allow for setting
> 
> A patch which introduces a TODO is basically telling me, it is not ready to go
> anywhere yet...
> 
>> +	 * the location of the mitigation, i.e.:
>> +	 *
>> +	 * kernel->user
>> +	 * kvm->guest
>> +	 * kvm->guest if device passthrough
>> +	 * kernel->idle
>> +	 */
>> +	return (mds_mitigation == MDS_MITIGATION_OFF &&
>> +		taa_mitigation == TAA_MITIGATION_OFF &&
>> +		mmio_mitigation == MMIO_MITIGATION_OFF &&
>> +		rfds_mitigation == RFDS_MITIGATION_OFF);
> 
> This should be used inside verw_mitigations_check() instead of repeated here,
> no?
> 
> Also, pls call verw_mitigations_check() "check_verw_mitigations" - the name
> should start with a verb.
> 
> Actually, you can merge verw_mitigations_check() and
> verw_mitigations_disabled(). Please do a *minimal* patch when cleaning this up
> - bugs.c is horrible. It should not get worse.
> 
I'll merge those two.

> What could also help is splitting this patch - it is hard to review as it
> is...
> 
Sure, I'll split this up as much as possible.
> Thx.
> 


  reply	other threads:[~2024-10-29 14:40 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-28 23:50 [PATCH 0/2] VERW based clean-up Daniel Sneddon
2024-10-28 23:50 ` [PATCH 1/2] x86/bugs: Check VERW mitigations for consistency Daniel Sneddon
2024-10-29 11:39   ` Borislav Petkov
2024-10-29 14:35     ` Daniel Sneddon
2024-10-29 16:32   ` Nikolay Borisov
2024-10-29 16:34     ` Daniel Sneddon
2024-10-28 23:50 ` [PATCH 2/2] x86/bugs: Clean-up verw mitigations Daniel Sneddon
2024-10-29 11:37   ` Borislav Petkov
2024-10-29 14:40     ` Daniel Sneddon [this message]
2024-10-29 15:00       ` Borislav Petkov
2024-10-29 15:33         ` Daniel Sneddon
2024-10-29 16:37           ` Borislav Petkov
2024-10-29 16:39             ` Daniel Sneddon
2024-10-28 23:53 ` [PATCH 0/2] VERW based clean-up Daniel Sneddon

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=c5fa82d7-e5e9-4612-a238-3c58152c40d0@linux.intel.com \
    --to=daniel.sneddon@linux.intel.com \
    --cc=bp@alien8.de \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pawan.kumar.gupta@linux.intel.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