diff mbox series

[2/6] KVM: x86: Use kvm_x86_ops in kvm_arch_check_processor_compat

Message ID 20211227081515.2088920-3-chao.gao@intel.com (mailing list archive)
State New, archived
Headers show
Series Improve KVM's interaction with CPU hotplug | expand

Commit Message

Chao Gao Dec. 27, 2021, 8:15 a.m. UTC
check_processor_compatibility() is a "runtime" ops now. Use
kvm_x86_ops directly such that kvm_arch_check_processor_compat
can be called at runtime.

Signed-off-by: Chao Gao <chao.gao@intel.com>
---
 arch/x86/kvm/x86.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Sean Christopherson Jan. 10, 2022, 9:10 p.m. UTC | #1
On Mon, Dec 27, 2021, Chao Gao wrote:
> check_processor_compatibility() is a "runtime" ops now. Use
> kvm_x86_ops directly such that kvm_arch_check_processor_compat
> can be called at runtime.
> 
> Signed-off-by: Chao Gao <chao.gao@intel.com>
> ---
>  arch/x86/kvm/x86.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 6411417b6871..770b68e72391 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -11383,7 +11383,6 @@ void kvm_arch_hardware_unsetup(void)
>  int kvm_arch_check_processor_compat(void *opaque)
>  {
>  	struct cpuinfo_x86 *c = &cpu_data(smp_processor_id());
> -	struct kvm_x86_init_ops *ops = opaque;
>  
>  	WARN_ON(!irqs_disabled());
>  
> @@ -11391,7 +11390,7 @@ int kvm_arch_check_processor_compat(void *opaque)
>  	    __cr4_reserved_bits(cpu_has, &boot_cpu_data))
>  		return -EIO;
>  
> -	return ops->runtime_ops->check_processor_compatibility();
> +	return kvm_x86_ops.check_processor_compatibility();

I'd just squash this with patch 01.  And might as well make this a static_call().

>  }
>  
>  bool kvm_vcpu_is_reset_bsp(struct kvm_vcpu *vcpu)
> -- 
> 2.25.1
>
Chao Gao Jan. 11, 2022, 3:06 a.m. UTC | #2
On Mon, Jan 10, 2022 at 09:10:10PM +0000, Sean Christopherson wrote:
>On Mon, Dec 27, 2021, Chao Gao wrote:
>> check_processor_compatibility() is a "runtime" ops now. Use
>> kvm_x86_ops directly such that kvm_arch_check_processor_compat
>> can be called at runtime.
>> 
>> Signed-off-by: Chao Gao <chao.gao@intel.com>
>> ---
>>  arch/x86/kvm/x86.c | 3 +--
>>  1 file changed, 1 insertion(+), 2 deletions(-)
>> 
>> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
>> index 6411417b6871..770b68e72391 100644
>> --- a/arch/x86/kvm/x86.c
>> +++ b/arch/x86/kvm/x86.c
>> @@ -11383,7 +11383,6 @@ void kvm_arch_hardware_unsetup(void)
>>  int kvm_arch_check_processor_compat(void *opaque)
>>  {
>>  	struct cpuinfo_x86 *c = &cpu_data(smp_processor_id());
>> -	struct kvm_x86_init_ops *ops = opaque;
>>  
>>  	WARN_ON(!irqs_disabled());
>>  
>> @@ -11391,7 +11390,7 @@ int kvm_arch_check_processor_compat(void *opaque)
>>  	    __cr4_reserved_bits(cpu_has, &boot_cpu_data))
>>  		return -EIO;
>>  
>> -	return ops->runtime_ops->check_processor_compatibility();
>> +	return kvm_x86_ops.check_processor_compatibility();
>
>I'd just squash this with patch 01.  And might as well make this a static_call().

Will do
diff mbox series

Patch

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 6411417b6871..770b68e72391 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -11383,7 +11383,6 @@  void kvm_arch_hardware_unsetup(void)
 int kvm_arch_check_processor_compat(void *opaque)
 {
 	struct cpuinfo_x86 *c = &cpu_data(smp_processor_id());
-	struct kvm_x86_init_ops *ops = opaque;
 
 	WARN_ON(!irqs_disabled());
 
@@ -11391,7 +11390,7 @@  int kvm_arch_check_processor_compat(void *opaque)
 	    __cr4_reserved_bits(cpu_has, &boot_cpu_data))
 		return -EIO;
 
-	return ops->runtime_ops->check_processor_compatibility();
+	return kvm_x86_ops.check_processor_compatibility();
 }
 
 bool kvm_vcpu_is_reset_bsp(struct kvm_vcpu *vcpu)