Kernel KVM virtualization development
 help / color / mirror / Atom feed
From: Tom Lendacky <thomas.lendacky@amd.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org,
	kvm@vger.kernel.org
Cc: "Joerg Roedel" <joro@8bytes.org>,
	"Borislav Petkov" <bp@alien8.de>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Radim Krčmář" <rkrcmar@redhat.com>
Subject: Re: [RFC PATCH 1/2] KVM: x86: Add a framework for supporting MSR-based features
Date: Tue, 13 Feb 2018 22:23:42 -0600	[thread overview]
Message-ID: <b0cb062f-4de8-abf3-4977-9e28cdf7d578@amd.com> (raw)
In-Reply-To: <45f3c26d-9580-7336-6c74-a0c1cd1e8963@redhat.com>

On 2/13/2018 10:21 AM, Paolo Bonzini wrote:
> On 08/02/2018 23:58, Tom Lendacky wrote:
>> Provide a new KVM capability that allows bits within MSRs to be recognized
>> as features.  Two new ioctls are added to the VM ioctl routine to retrieve
>> the list of these MSRs and their values. The MSR features can optionally
>> be exposed based on a CPU and/or a CPU feature.
> 
> Yes, pretty much.  Just two changes:
> 
>> +struct kvm_msr_based_features {
>> +	u32 msr;			/* MSR to query */
>> +	u64 mask;			/* MSR mask */
>> +	const struct x86_cpu_id *match;	/* Match criteria */
>> +	u64 value;			/* MSR value */
> 
> 1) These two should be replaced by a kvm_x86_ops callback, because
> computing the value is sometimes a bit more complicated than just rdmsr
> (for example, MSRs for VMX capabilities depend on the kvm_intel.ko
> module parameters).

Ok, I'll rework this.

> 
> 
>> +	case KVM_CAP_GET_MSR_FEATURES:
> 
> This should be KVM_GET_MSR.

Yup, not sure what I was thinking there.

> 
>> +		r = msr_io(NULL, argp, do_get_msr_features, 1);
>> +		break;
> 
> 
> Bonus points for writing documentation :) and for moving the MSR> handling code to arch/x86/kvm/msr.{c,h}.

Yup, there will be documentation on it - I wanted to make sure the
direction was correct first.  Splitting out msr.c/msr.h might be
best as a separate patchset, let me see what's involved.

Thanks,
Tom

> 
> Thanks,
> 
> Paolo
> 

  reply	other threads:[~2018-02-14  4:23 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-08 22:58 [RFC PATCH 0/2] KVM: MSR-based features Tom Lendacky
2018-02-08 22:58 ` [RFC PATCH 1/2] KVM: x86: Add a framework for supporting " Tom Lendacky
2018-02-13 16:21   ` Paolo Bonzini
2018-02-14  4:23     ` Tom Lendacky [this message]
2018-02-13 16:25   ` Paolo Bonzini
2018-02-14  4:42     ` Tom Lendacky
2018-02-14 16:41       ` Paolo Bonzini
2018-02-14 16:44   ` Borislav Petkov
2018-02-14 16:58     ` Paolo Bonzini
2018-02-08 22:58 ` [RFC PATCH 2/2] KVM: SVM: Add MSR feature support for serializing LFENCE Tom Lendacky
2018-02-13 16:22   ` Paolo Bonzini
2018-02-14  4:39     ` Tom Lendacky
2018-02-14 10:08       ` Paolo Bonzini
2018-02-08 23:03 ` [RFC PATCH 0/2] KVM: MSR-based features Tom Lendacky

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=b0cb062f-4de8-abf3-4977-9e28cdf7d578@amd.com \
    --to=thomas.lendacky@amd.com \
    --cc=bp@alien8.de \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rkrcmar@redhat.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