All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Dave Hansen <dave.hansen@intel.com>
Cc: David Kaplan <david.kaplan@amd.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Borislav Petkov <bp@alien8.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Josh Poimboeuf <jpoimboe@kernel.org>,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Ingo Molnar <mingo@redhat.com>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] x86/bugs: Restructure ITS mitigation
Date: Sat, 17 May 2025 15:19:48 +0200	[thread overview]
Message-ID: <aCiM9BebdBUEBK3E@gmail.com> (raw)
In-Reply-To: <ba2239fb-6740-42c6-b6aa-e1c7a575b83d@intel.com>


* Dave Hansen <dave.hansen@intel.com> wrote:

> On 5/16/25 12:32, David Kaplan wrote:
> > Restructure the ITS mitigation to use select/update/apply functions like
> > the other mitigations.
> > 
> > There is a particularly complex interaction between ITS and Retbleed as CDT
> > (Call Depth Tracking) is a mitigation for both, and either its=stuff or
> > retbleed=stuff will attempt to enable CDT.
> > 
> > retbleed_update_mitigation() runs first and will check the necessary
> > pre-conditions for CDT if either ITS or Retbleed stuffing is selected.  If
> > checks pass and ITS stuffing is selected, it will select stuffing for
> > Retbleed as well.
> > 
> > its_update_mitigation() runs after and will either select stuffing if
> > retbleed stuffing was enabled, or fall back to the default (aligned thunks)
> > if stuffing could not be enabled.
> > 
> > Enablement of CDT is done exclusively in retbleed_apply_mitigation().
> > its_apply_mitigation() is only used to enable aligned thunks.
> 
> This seems to be explaining what is going on, but there isn't a clear
> problem that this is fixing.
> 
> Why does this need restructuring?

All other mitigations have the following methods:

  static void __init bhi_select_mitigation(void);
  static void __init bhi_update_mitigation(void);
  static void __init bhi_apply_mitigation(void);

(The _update() method is optional.)

Except the freshly added ITS mitigation breaks this pattern, which has 
all this functionality in a single function:

  static void __init its_select_mitigation(void);

David's patch refactors the recently added ITS code to follow the 
existing pattern of all the other mitigation methods:

  static void __init its_select_mitigation(void);
  static void __init its_update_mitigation(void);
  static void __init its_apply_mitigation(void);

This makes it easier to read if you know the other mitigations already, 
and makes it easier to maintain going forward.

Thanks,

	Ingo

  reply	other threads:[~2025-05-17 13:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-15 13:47 [PATCH] x86/bugs: Restructure ITS mitigation David Kaplan
2025-05-15 15:16 ` Borislav Petkov
2025-05-15 21:11 ` Pawan Gupta
2025-05-15 21:15   ` Kaplan, David
2025-05-15 22:02     ` Pawan Gupta
2025-05-16 14:56       ` Borislav Petkov
2025-05-15 23:52 ` Pawan Gupta
2025-05-16 15:06   ` Kaplan, David
2025-05-19 23:51     ` Pawan Gupta
2025-05-16 19:32 ` [PATCH v2] " David Kaplan
2025-05-16 22:47   ` Dave Hansen
2025-05-17 13:19     ` Ingo Molnar [this message]
2025-05-17 13:25     ` Borislav Petkov
2025-05-20 16:32   ` Pawan Gupta
2025-05-20 16:48     ` Borislav Petkov
2025-05-20 16:57       ` Pawan Gupta
2025-05-20 16:54   ` [tip: x86/core] " tip-bot2 for David Kaplan
2025-05-21  6:56   ` tip-bot2 for David Kaplan

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=aCiM9BebdBUEBK3E@gmail.com \
    --to=mingo@kernel.org \
    --cc=bp@alien8.de \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=david.kaplan@amd.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.