public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Dave Hansen <dave.hansen@intel.com>
To: Jim Mattson <jmattson@google.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
	Pawan Gupta <pawan.kumar.gupta@linux.intel.com>,
	Jiaxi Chen <jiaxi.chen@linux.intel.com>,
	Kim Phillips <kim.phillips@amd.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org, Dave Hansen <dave.hansen@linux.intel.com>,
	Borislav Petkov <bp@alien8.de>, Ingo Molnar <mingo@redhat.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] x86: KVM: Add feature flag for AMD's FsGsKernelGsBaseNonSerializing
Date: Tue, 3 Oct 2023 17:57:23 -0700	[thread overview]
Message-ID: <01009a2a-929e-ce16-6f44-1d314e6bcba5@intel.com> (raw)
In-Reply-To: <20231004002038.907778-1-jmattson@google.com>

On 10/3/23 17:20, Jim Mattson wrote:
> Define an X86_FEATURE_* flag for
> CPUID.80000021H:EAX.FsGsKernelGsBaseNonSerializing[bit 1], and
> advertise the feature to userspace via KVM_GET_SUPPORTED_CPUID.
...
> +#define X86_FEATURE_BASES_NON_SERIAL	(20*32+ 1) /* "" FSBASE, GSBASE, and KERNELGSBASE are non-serializing */

This is failing to differentiate two *VERY* different things.

FSBASE, GSBASE, and KERNELGSBASE themselves are registers.  They have
*NOTHING* to do with serialization.  WRFSBASE, for instance is not
serializing.  Reading (with RDMSR) or using any of those three registers
is not serializing.

The *ONLY* thing that relates them to serialization is the WRMSR
instruction which itself is (mostly) architecturally serializing and the
fact that WRMSR has historically been the main way to write those three
registers.

The AMD docs call this out, which helps.  But the changelog, comments
and probably the feature naming need some work.

Why does this matter, btw?  Why do guests need this bit passed through?

  reply	other threads:[~2023-10-04  0:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04  0:20 [PATCH] x86: KVM: Add feature flag for AMD's FsGsKernelGsBaseNonSerializing Jim Mattson
2023-10-04  0:57 ` Dave Hansen [this message]
2023-10-04  2:44   ` Jim Mattson
2023-10-04  3:27     ` Dave Hansen
2023-10-04  4:24       ` Jim Mattson
2023-10-04  7:58     ` Borislav Petkov
2023-10-04 20:29       ` Jim Mattson
2023-10-05 16:22       ` Jim Mattson
2023-10-05 16:35         ` Dave Hansen
2023-10-05 16:41           ` Jim Mattson
2023-10-05 16:51             ` Paolo Bonzini
2023-10-05 17:52             ` Dave Hansen
2023-10-05 16:38       ` Paolo Bonzini
2023-10-05 17:06         ` Jim Mattson
2023-10-05 17:14           ` Paolo Bonzini
2023-10-05 17:27             ` Jim Mattson

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=01009a2a-929e-ce16-6f44-1d314e6bcba5@intel.com \
    --to=dave.hansen@intel.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jiaxi.chen@linux.intel.com \
    --cc=jmattson@google.com \
    --cc=kim.phillips@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pawan.kumar.gupta@linux.intel.com \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --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