Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1360496

Re: [PART1 RFC v3 03/12] KVM: x86: Introducing kvm_x86_ops VCPU blocking/unblocking hooks

From Paolo Bonzini <pbonzini@redhat.com>
Newsgroups linux.kernel
Subject Re: [PART1 RFC v3 03/12] KVM: x86: Introducing kvm_x86_ops VCPU blocking/unblocking hooks
Date 2016-03-18 11:20 +0100
Message-ID <rdZFE-4dR-19@gated-at.bofh.it> (permalink)
References <rdVVn-1Lv-3@gated-at.bofh.it> <rdVVo-1Lv-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw



On 18/03/2016 07:09, Suravee Suthikulpanit wrote:
> Adding new function pointer in struct kvm_x86_ops, and calling them
> from the kvm_arch_vcpu[blocking/unblocking].
> 
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
>  arch/x86/include/asm/kvm_host.h | 17 +++++++++++++++--
>  1 file changed, 15 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
> index 4b0dd0f..87eac2a 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -972,6 +972,10 @@ struct kvm_x86_ops {
>  	 */
>  	int (*pre_block)(struct kvm_vcpu *vcpu);
>  	void (*post_block)(struct kvm_vcpu *vcpu);
> +
> +	void (*vcpu_blocking)(struct kvm_vcpu *vcpu);
> +	void (*vcpu_unblocking)(struct kvm_vcpu *vcpu);
> +
>  	int (*update_pi_irte)(struct kvm *kvm, unsigned int host_irq,
>  			      uint32_t guest_irq, bool set);
>  };
> @@ -1323,7 +1327,16 @@ bool kvm_intr_is_single_vcpu(struct kvm *kvm, struct kvm_lapic_irq *irq,
>  void kvm_set_msi_irq(struct kvm_kernel_irq_routing_entry *e,
>  		     struct kvm_lapic_irq *irq);
>  
> -static inline void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu) {}
> -static inline void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcpu) {}
> +static inline void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu)
> +{
> +	if (kvm_x86_ops->vcpu_blocking)
> +		kvm_x86_ops->vcpu_blocking(vcpu);
> +}
> +
> +static inline void kvm_arch_vcpu_unblocking(struct kvm_vcpu *vcpu)
> +{
> +	if (kvm_x86_ops->vcpu_unblocking)
> +		kvm_x86_ops->vcpu_unblocking(vcpu);
> +}
>  
>  #endif /* _ASM_X86_KVM_HOST_H */
> 

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PART1 RFC v3 00/12] KVM: x86: Introduce SVM AVIC support Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2016-03-18 07:20 +0100
  [PART1 RFC v3 11/12] svm: Do not intercept CR8 when enable AVIC Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2016-03-18 07:20 +0100
    Re: [PART1 RFC v3 11/12] svm: Do not intercept CR8 when enable AVIC Radim Krčmář <rkrcmar@redhat.com> - 2016-03-18 22:20 +0100
  [PART1 RFC v3 03/12] KVM: x86: Introducing kvm_x86_ops VCPU blocking/unblocking hooks Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2016-03-18 07:20 +0100
    Re: [PART1 RFC v3 03/12] KVM: x86: Introducing kvm_x86_ops VCPU  blocking/unblocking hooks Paolo Bonzini <pbonzini@redhat.com> - 2016-03-18 11:20 +0100
  [PART1 RFC v3 05/12] svm: Introduce new AVIC VMCB registers Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2016-03-18 07:20 +0100
  [PART1 RFC v3 01/12] KVM: x86: Misc LAPIC changes to expose helper functions Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2016-03-18 07:20 +0100
    Re: [PART1 RFC v3 01/12] KVM: x86: Misc LAPIC changes to expose  helper functions Paolo Bonzini <pbonzini@redhat.com> - 2016-03-18 12:20 +0100
  [PART1 RFC v3 12/12] svm: Manage vcpu load/unload when enable AVIC Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2016-03-18 07:20 +0100
    Re: [PART1 RFC v3 12/12] svm: Manage vcpu load/unload when enable  AVIC Radim Krčmář <rkrcmar@redhat.com> - 2016-03-18 22:50 +0100
      Re: [PART1 RFC v3 12/12] svm: Manage vcpu load/unload when enable  AVIC Radim Krčmář <rkrcmar@redhat.com> - 2016-03-31 16:20 +0200
  [PART1 RFC v3 06/12] KVM: x86: Detect and Initialize AVIC support Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2016-03-18 07:20 +0100
    Re: [PART1 RFC v3 06/12] KVM: x86: Detect and Initialize AVIC support Paolo Bonzini <pbonzini@redhat.com> - 2016-03-18 12:30 +0100
  [PART1 RFC v3 10/12] svm: Do not expose x2APIC when enable AVIC Suravee Suthikulpanit <Suravee.Suthikulpanit@amd.com> - 2016-03-18 07:20 +0100
    Re: [PART1 RFC v3 10/12] svm: Do not expose x2APIC when enable AVIC Radim Krčmář <rkrcmar@redhat.com> - 2016-03-18 22:10 +0100
      Re: [PART1 RFC v3 10/12] svm: Do not expose x2APIC when enable AVIC Paolo Bonzini <pbonzini@redhat.com> - 2016-03-31 13:30 +0200

csiph-web