linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Maxim Levitsky <mlevitsk@redhat.com>
To: Vitaly Kuznetsov <vkuznets@redhat.com>,
	kvm@vger.kernel.org, Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC 04/11] KVM: x86: hyper-v: Introduce kvm_hv_synic_auto_eoi_set()
Date: Thu, 12 Oct 2023 22:36:35 +0300	[thread overview]
Message-ID: <ccea65f81ed5530189f2d24af7c16158cf5ee1cd.camel@redhat.com> (raw)
In-Reply-To: <20231010160300.1136799-5-vkuznets@redhat.com>

У вт, 2023-10-10 у 18:02 +0200, Vitaly Kuznetsov пише:
> As a preparation to making Hyper-V emulation optional, create a dedicated
> kvm_hv_synic_auto_eoi_set() helper to avoid extra ifdefs in lapic.c
> 
> No functional change intended.
> 
> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com>
> ---
>  arch/x86/kvm/hyperv.h | 5 +++++
>  arch/x86/kvm/lapic.c  | 2 +-
>  2 files changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kvm/hyperv.h b/arch/x86/kvm/hyperv.h
> index f83b8db72b11..1897a219981d 100644
> --- a/arch/x86/kvm/hyperv.h
> +++ b/arch/x86/kvm/hyperv.h
> @@ -105,6 +105,11 @@ int kvm_hv_synic_set_irq(struct kvm *kvm, u32 vcpu_id, u32 sint);
>  void kvm_hv_synic_send_eoi(struct kvm_vcpu *vcpu, int vector);
>  int kvm_hv_activate_synic(struct kvm_vcpu *vcpu, bool dont_zero_synic_pages);
>  
> +static inline bool kvm_hv_synic_auto_eoi_set(struct kvm_vcpu *vcpu, int vector)
> +{
> +	return to_hv_vcpu(vcpu) && test_bit(vector, to_hv_synic(vcpu)->auto_eoi_bitmap);
> +}
> +
>  void kvm_hv_vcpu_uninit(struct kvm_vcpu *vcpu);
>  
>  bool kvm_hv_assist_page_enabled(struct kvm_vcpu *vcpu);
> diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c
> index dcd60b39e794..0e80c1fdf899 100644
> --- a/arch/x86/kvm/lapic.c
> +++ b/arch/x86/kvm/lapic.c
> @@ -2899,7 +2899,7 @@ int kvm_get_apic_interrupt(struct kvm_vcpu *vcpu)
>  	 */
>  
>  	apic_clear_irr(vector, apic);
> -	if (to_hv_vcpu(vcpu) && test_bit(vector, to_hv_synic(vcpu)->auto_eoi_bitmap)) {
> +	if (kvm_hv_synic_auto_eoi_set(vcpu, vector)) {
>  		/*
>  		 * For auto-EOI interrupts, there might be another pending
>  		 * interrupt above PPR, so check whether to raise another

Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>

Best regards,
	Maxim Levitsky


  reply	other threads:[~2023-10-12 19:37 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-10 16:02 [PATCH RFC 00/11] KVM: x86: Make Hyper-V emulation optional (AKA introduce CONFIG_KVM_HYPERV) Vitaly Kuznetsov
2023-10-10 16:02 ` [PATCH RFC 01/11] KVM: x86: xen: Remove unneeded xen context from struct kvm_arch when !CONFIG_KVM_XEN Vitaly Kuznetsov
2023-10-12 19:30   ` Maxim Levitsky
2023-10-10 16:02 ` [PATCH RFC 02/11] KVM: x86: hyper-v: Move Hyper-V partition assist page out of Hyper-V emulation context Vitaly Kuznetsov
2023-10-12 19:35   ` Maxim Levitsky
2023-10-16 12:45     ` Vitaly Kuznetsov
2023-10-10 16:02 ` [PATCH RFC 03/11] KVM: VMX: Split off vmx_onhyperv.{ch} from hyperv.{ch} Vitaly Kuznetsov
2023-10-12 19:36   ` Maxim Levitsky
2023-10-10 16:02 ` [PATCH RFC 04/11] KVM: x86: hyper-v: Introduce kvm_hv_synic_auto_eoi_set() Vitaly Kuznetsov
2023-10-12 19:36   ` Maxim Levitsky [this message]
2023-10-10 16:02 ` [PATCH RFC 05/11] KVM: x86: hyper-v: Introduce kvm_hv_synic_has_vector() Vitaly Kuznetsov
2023-10-12 19:36   ` Maxim Levitsky
2023-10-10 16:02 ` [PATCH RFC 06/11] KVM: VMX: Split off hyperv_evmcs.{ch} Vitaly Kuznetsov
2023-10-12 19:40   ` Maxim Levitsky
2023-10-16 12:47     ` Vitaly Kuznetsov
2023-10-10 16:02 ` [PATCH RFC 07/11] KVM: x86: Make Hyper-V emulation optional Vitaly Kuznetsov
2023-10-12 19:49   ` Maxim Levitsky
2023-10-16 12:53     ` Vitaly Kuznetsov
2023-10-16 15:27       ` Sean Christopherson
2023-10-16 15:43         ` Vitaly Kuznetsov
2023-10-16 16:45           ` Sean Christopherson
2023-10-10 16:02 ` [PATCH RFC 08/11] KVM: nVMX: hyper-v: Introduce nested_vmx_evmptr() accessor Vitaly Kuznetsov
2023-10-12 19:50   ` Maxim Levitsky
2023-10-16 13:49     ` Vitaly Kuznetsov
2023-10-16 16:55       ` Sean Christopherson
2023-10-10 16:02 ` [PATCH RFC 09/11] KVM: nVMX: hyper-v: Introduce nested_vmx_evmcs() accessor Vitaly Kuznetsov
2023-10-12 19:51   ` Maxim Levitsky
2023-10-10 16:02 ` [PATCH RFC 10/11] KVM: nVMX: hyper-v: Hide more stuff under CONFIG_KVM_HYPERV Vitaly Kuznetsov
2023-10-12 19:51   ` Maxim Levitsky
2023-10-10 16:03 ` [PATCH RFC 11/11] KVM: nSVM: hyper-v: Hide more stuff under CONFIG_KVM_HYPERV/CONFIG_HYPERV Vitaly Kuznetsov
2023-10-12 19:51   ` Maxim Levitsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ccea65f81ed5530189f2d24af7c16158cf5ee1cd.camel@redhat.com \
    --to=mlevitsk@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=seanjc@google.com \
    --cc=vkuznets@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).