linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] KVM: x86: hide KVM_HC_CLOCK_PAIRING on 32 bit
@ 2017-02-09 15:10 Arnd Bergmann
  2017-02-09 15:24 ` Paolo Bonzini
  0 siblings, 1 reply; 2+ messages in thread
From: Arnd Bergmann @ 2017-02-09 15:10 UTC (permalink / raw)
  To: Paolo Bonzini, Radim Krčmář
  Cc: Arnd Bergmann, Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Xiao Guangrong, Borislav Petkov, Tom Lendacky, Marcelo Tosatti,
	Sebastian Andrzej Siewior, kvm, linux-kernel

The newly added hypercall doesn't work on x86-32:

arch/x86/kvm/x86.c: In function 'kvm_pv_clock_pairing':
arch/x86/kvm/x86.c:6163:6: error: implicit declaration of function 'kvm_get_walltime_and_clockread';did you mean 'kvm_get_time_scale'? [-Werror=implicit-function-declaration]

This adds an #ifdef around it, matching the one around the related
functions that are also only implemented on 64-bit systems.

Fixes: 55dd00a73a51 ("KVM: x86: add KVM_HC_CLOCK_PAIRING hypercall")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
 arch/x86/kvm/x86.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 10e20afc3314..2bcdc88c8242 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -6149,6 +6149,7 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu)
 }
 EXPORT_SYMBOL_GPL(kvm_emulate_halt);
 
+#ifdef CONFIG_X86_64
 static int kvm_pv_clock_pairing(struct kvm_vcpu *vcpu, gpa_t paddr,
 			        unsigned long clock_type)
 {
@@ -6175,6 +6176,7 @@ static int kvm_pv_clock_pairing(struct kvm_vcpu *vcpu, gpa_t paddr,
 
 	return ret;
 }
+#endif
 
 /*
  * kvm_pv_kick_cpu_op:  Kick a vcpu.
@@ -6240,9 +6242,11 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu)
 		kvm_pv_kick_cpu_op(vcpu->kvm, a0, a1);
 		ret = 0;
 		break;
+#ifdef CONFIG_X86_64
 	case KVM_HC_CLOCK_PAIRING:
 		ret = kvm_pv_clock_pairing(vcpu, a0, a1);
 		break;
+#endif
 	default:
 		ret = -KVM_ENOSYS;
 		break;
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] KVM: x86: hide KVM_HC_CLOCK_PAIRING on 32 bit
  2017-02-09 15:10 [PATCH] KVM: x86: hide KVM_HC_CLOCK_PAIRING on 32 bit Arnd Bergmann
@ 2017-02-09 15:24 ` Paolo Bonzini
  0 siblings, 0 replies; 2+ messages in thread
From: Paolo Bonzini @ 2017-02-09 15:24 UTC (permalink / raw)
  To: Arnd Bergmann, Radim Krčmář
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Xiao Guangrong, Borislav Petkov, Tom Lendacky, Marcelo Tosatti,
	Sebastian Andrzej Siewior, kvm, linux-kernel



On 09/02/2017 16:10, Arnd Bergmann wrote:
> The newly added hypercall doesn't work on x86-32:
> 
> arch/x86/kvm/x86.c: In function 'kvm_pv_clock_pairing':
> arch/x86/kvm/x86.c:6163:6: error: implicit declaration of function 'kvm_get_walltime_and_clockread';did you mean 'kvm_get_time_scale'? [-Werror=implicit-function-declaration]
> 
> This adds an #ifdef around it, matching the one around the related
> functions that are also only implemented on 64-bit systems.
> 
> Fixes: 55dd00a73a51 ("KVM: x86: add KVM_HC_CLOCK_PAIRING hypercall")
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  arch/x86/kvm/x86.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index 10e20afc3314..2bcdc88c8242 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -6149,6 +6149,7 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu)
>  }
>  EXPORT_SYMBOL_GPL(kvm_emulate_halt);
>  
> +#ifdef CONFIG_X86_64
>  static int kvm_pv_clock_pairing(struct kvm_vcpu *vcpu, gpa_t paddr,
>  			        unsigned long clock_type)
>  {
> @@ -6175,6 +6176,7 @@ static int kvm_pv_clock_pairing(struct kvm_vcpu *vcpu, gpa_t paddr,
>  
>  	return ret;
>  }
> +#endif
>  
>  /*
>   * kvm_pv_kick_cpu_op:  Kick a vcpu.
> @@ -6240,9 +6242,11 @@ int kvm_emulate_hypercall(struct kvm_vcpu *vcpu)
>  		kvm_pv_kick_cpu_op(vcpu->kvm, a0, a1);
>  		ret = 0;
>  		break;
> +#ifdef CONFIG_X86_64
>  	case KVM_HC_CLOCK_PAIRING:
>  		ret = kvm_pv_clock_pairing(vcpu, a0, a1);
>  		break;
> +#endif
>  	default:
>  		ret = -KVM_ENOSYS;
>  		break;
> 

Applied, thanks.

Paolo

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-09 15:24 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-09 15:10 [PATCH] KVM: x86: hide KVM_HC_CLOCK_PAIRING on 32 bit Arnd Bergmann
2017-02-09 15:24 ` Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).