Skip to content

Commit

Permalink
KVM: x86: Make kvm_mpx_supported() an inline function
Browse files Browse the repository at this point in the history
Expose kvm_mpx_supported() as a static inline so that it can be inlined
in kvm_intel.ko.

No functional change intended.

Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
Sean Christopherson authored and Paolo Bonzini committed Mar 16, 2020
1 parent 7f5581f commit 615a4ae
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
7 changes: 0 additions & 7 deletions arch/x86/kvm/cpuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,6 @@ static u32 xstate_required_size(u64 xstate_bv, bool compacted)
return ret;
}

bool kvm_mpx_supported(void)
{
return (supported_xcr0 & (XFEATURE_MASK_BNDREGS | XFEATURE_MASK_BNDCSR))
== (XFEATURE_MASK_BNDREGS | XFEATURE_MASK_BNDCSR);
}
EXPORT_SYMBOL_GPL(kvm_mpx_supported);

#define F feature_bit

int kvm_update_cpuid(struct kvm_vcpu *vcpu)
Expand Down
1 change: 0 additions & 1 deletion arch/x86/kvm/cpuid.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <asm/processor.h>

int kvm_update_cpuid(struct kvm_vcpu *vcpu);
bool kvm_mpx_supported(void);
struct kvm_cpuid_entry2 *kvm_find_cpuid_entry(struct kvm_vcpu *vcpu,
u32 function, u32 index);
int kvm_dev_ioctl_get_cpuid(struct kvm_cpuid2 *cpuid,
Expand Down
6 changes: 6 additions & 0 deletions arch/x86/kvm/x86.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,12 @@ enum exit_fastpath_completion handle_fastpath_set_msr_irqoff(struct kvm_vcpu *vc
extern u64 host_xcr0;
extern u64 supported_xcr0;

static inline bool kvm_mpx_supported(void)
{
return (supported_xcr0 & (XFEATURE_MASK_BNDREGS | XFEATURE_MASK_BNDCSR))
== (XFEATURE_MASK_BNDREGS | XFEATURE_MASK_BNDCSR);
}

extern unsigned int min_timer_period_us;

extern bool enable_vmware_backdoor;
Expand Down

0 comments on commit 615a4ae

Please sign in to comment.