Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
Cc: Josh Poimboeuf <jpoimboe@kernel.org>,
	x86@kernel.org,  Paolo Bonzini <pbonzini@redhat.com>,
	linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Subject: Re: [PATCH] x86/bugs/mmio: Rename mmio_stale_data_clear to cpu_buf_vm_clear
Date: Thu, 10 Apr 2025 13:39:28 -0700	[thread overview]
Message-ID: <Z_gsgHzgGWqnNwKv@google.com> (raw)
In-Reply-To: <20250410-mmio-rename-v1-1-fd4b2e7fc04e@linux.intel.com>

On Thu, Apr 10, 2025, Pawan Gupta wrote:
> The static key mmio_stale_data_clear controls the KVM-only mitigation for
> MMIO Stale Data vulnerability. Rename it to reflect its purpose.
> 
> No functional change.
> 
> Signed-off-by: Pawan Gupta <pawan.kumar.gupta@linux.intel.com>
> ---
>  arch/x86/include/asm/nospec-branch.h |  2 +-
>  arch/x86/kernel/cpu/bugs.c           | 16 ++++++++++------
>  arch/x86/kvm/vmx/vmx.c               |  2 +-
>  3 files changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/arch/x86/include/asm/nospec-branch.h b/arch/x86/include/asm/nospec-branch.h
> index 8a5cc8e70439e10aab4eeb5b0f5e116cf635b43d..c0474e2b741737dad129159adf3b5fc056b6097c 100644
> --- a/arch/x86/include/asm/nospec-branch.h
> +++ b/arch/x86/include/asm/nospec-branch.h
> @@ -561,7 +561,7 @@ DECLARE_STATIC_KEY_FALSE(mds_idle_clear);
>  
>  DECLARE_STATIC_KEY_FALSE(switch_mm_cond_l1d_flush);
>  
> -DECLARE_STATIC_KEY_FALSE(mmio_stale_data_clear);
> +DECLARE_STATIC_KEY_FALSE(cpu_buf_vm_clear);

Could we tack on "if_mmio" or something?  E.g. cpu_buf_vm_clear_if_mmio.  FWIW,
I don't love that name, so if anyone can come up with something better...

I like the idea of tying the static key back to X86_FEATURE_CLEAR_CPU_BUF, but
when looking at just the usage in KVM, "cpu_buf_vm_clear" doesn't provide any
hints as to when/why KVM needs to clear buffers.

  parent reply	other threads:[~2025-04-10 20:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-10 17:49 [PATCH] x86/bugs/mmio: Rename mmio_stale_data_clear to cpu_buf_vm_clear Pawan Gupta
2025-04-10 18:04 ` Borislav Petkov
2025-04-10 20:39 ` Sean Christopherson [this message]
2025-04-10 22:13   ` Pawan Gupta
2025-04-10 23:35     ` Sean Christopherson
2025-04-11  0:17       ` Pawan Gupta

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=Z_gsgHzgGWqnNwKv@google.com \
    --to=seanjc@google.com \
    --cc=jpoimboe@kernel.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=pbonzini@redhat.com \
    --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