Message ID | 20181105184432.18555-1-sean.j.christopherson@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | KVM: x86: Remove KF() macro placeholder | expand |
On 05/11/18 19:44, Sean Christopherson wrote: > Although well-intentioned, keeping the KF() definition as a hint for > handling scattered CPUID features may be counter-productive. Simply > redefining the bit position only works for directly manipulating the > guest's CPUID leafs, e.g. it doesn't make guest_cpuid_has() magically > work. Taking an alternative approach, e.g. ensuring the bit position > is identical between the Linux-defined and hardware-defined features, > may be a simpler and/or more effective method of exposing scattered > features to the guest. > > Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> > --- > arch/x86/kvm/cpuid.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > index 7bcfa61375c0..fb2feaf78daf 100644 > --- a/arch/x86/kvm/cpuid.c > +++ b/arch/x86/kvm/cpuid.c > @@ -67,9 +67,6 @@ u64 kvm_supported_xcr0(void) > > #define F(x) bit(X86_FEATURE_##x) > > -/* For scattered features from cpufeatures.h; we currently expose none */ > -#define KF(x) bit(KVM_CPUID_BIT_##x) > - > int kvm_update_cpuid(struct kvm_vcpu *vcpu) > { > struct kvm_cpuid_entry2 *best; > Queued, thanks. Paolo
On Mon, Nov 26, 2018 at 05:48:55PM +0100, Paolo Bonzini wrote: > On 05/11/18 19:44, Sean Christopherson wrote: > > Although well-intentioned, keeping the KF() definition as a hint for > > handling scattered CPUID features may be counter-productive. Simply > > redefining the bit position only works for directly manipulating the > > guest's CPUID leafs, e.g. it doesn't make guest_cpuid_has() magically > > work. Taking an alternative approach, e.g. ensuring the bit position > > is identical between the Linux-defined and hardware-defined features, > > may be a simpler and/or more effective method of exposing scattered > > features to the guest. > > > > Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> > > --- > > arch/x86/kvm/cpuid.c | 3 --- > > 1 file changed, 3 deletions(-) > > > > diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c > > index 7bcfa61375c0..fb2feaf78daf 100644 > > --- a/arch/x86/kvm/cpuid.c > > +++ b/arch/x86/kvm/cpuid.c > > @@ -67,9 +67,6 @@ u64 kvm_supported_xcr0(void) > > > > #define F(x) bit(X86_FEATURE_##x) > > > > -/* For scattered features from cpufeatures.h; we currently expose none */ > > -#define KF(x) bit(KVM_CPUID_BIT_##x) > > - > > int kvm_update_cpuid(struct kvm_vcpu *vcpu) > > { > > struct kvm_cpuid_entry2 *best; > > > > Queued, thanks. > > Paolo Looks like this never made it to kvm/queue.
2018-12-18 12:51-0800, Sean Christopherson: > On Mon, Nov 26, 2018 at 05:48:55PM +0100, Paolo Bonzini wrote: > > Queued, thanks. > > > > Paolo > > Looks like this never made it to kvm/queue. The paths of the just are long. Should be there now, thanks.
diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index 7bcfa61375c0..fb2feaf78daf 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -67,9 +67,6 @@ u64 kvm_supported_xcr0(void) #define F(x) bit(X86_FEATURE_##x) -/* For scattered features from cpufeatures.h; we currently expose none */ -#define KF(x) bit(KVM_CPUID_BIT_##x) - int kvm_update_cpuid(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best;
Although well-intentioned, keeping the KF() definition as a hint for handling scattered CPUID features may be counter-productive. Simply redefining the bit position only works for directly manipulating the guest's CPUID leafs, e.g. it doesn't make guest_cpuid_has() magically work. Taking an alternative approach, e.g. ensuring the bit position is identical between the Linux-defined and hardware-defined features, may be a simpler and/or more effective method of exposing scattered features to the guest. Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> --- arch/x86/kvm/cpuid.c | 3 --- 1 file changed, 3 deletions(-)