All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Tom Lendacky <thomas.lendacky@amd.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 17:21:00 +0100	[thread overview]
Message-ID: <45f3c26d-9580-7336-6c74-a0c1cd1e8963@redhat.com> (raw)
In-Reply-To: <20180208225846.22074.70944.stgit@tlendack-t1.amdoffice.net>

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).


> +	case KVM_CAP_GET_MSR_FEATURES:

This should be KVM_GET_MSR.

> +		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}.

Thanks,

Paolo

  reply	other threads:[~2018-02-13 16:21 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 [this message]
2018-02-14  4:23     ` Tom Lendacky
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=45f3c26d-9580-7336-6c74-a0c1cd1e8963@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=bp@alien8.de \
    --cc=joro@8bytes.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rkrcmar@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.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 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.