lkml.org 
[lkml]   [2018]   [Feb]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC PATCH 1/2] KVM: x86: Add a framework for supporting MSR-based features
From
Date
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

\
 
 \ /
  Last update: 2018-02-13 17:21    [W:0.105 / U:13.368 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site