From: Maxim Levitsky <mlevitsk@redhat.com>
To: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>,
linux-kernel@vger.kernel.org, kvm@vger.kernel.org
Cc: pbonzini@redhat.com, joro@8bytes.org, jon.grimm@amd.com,
Alexander Graf <graf@amazon.com>
Subject: Re: [PATCH] KVM: x86: Fixes posted interrupt check for IRQs delivery modes
Date: Sat, 02 May 2020 16:13:08 +0300 [thread overview]
Message-ID: <35c7c404406729dc05d0977c9d322655f2b1c4a9.camel@redhat.com> (raw)
In-Reply-To: <1586239989-58305-1-git-send-email-suravee.suthikulpanit@amd.com>
On Tue, 2020-04-07 at 01:13 -0500, Suravee Suthikulpanit wrote:
> Current logic incorrectly uses the enum ioapic_irq_destination_types
> to check the posted interrupt destination types. However, the value
> was
> set using APIC_DM_XXX macros, which are left-shifted by 8 bits.
>
> Fixes by using the APIC_DM_FIXED and APIC_DM_LOWEST instead.
>
> Fixes: (fdcf75621375 'KVM: x86: Disable posted interrupts for non-
> standard IRQs delivery modes')
> Cc: Alexander Graf <graf@amazon.com>
> Signed-off-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com>
> ---
> arch/x86/include/asm/kvm_host.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/kvm_host.h
> b/arch/x86/include/asm/kvm_host.h
> index 98959e8..f15e5b3 100644
> --- a/arch/x86/include/asm/kvm_host.h
> +++ b/arch/x86/include/asm/kvm_host.h
> @@ -1664,8 +1664,8 @@ void kvm_set_msi_irq(struct kvm *kvm, struct
> kvm_kernel_irq_routing_entry *e,
> static inline bool kvm_irq_is_postable(struct kvm_lapic_irq *irq)
> {
> /* We can only post Fixed and LowPrio IRQs */
> - return (irq->delivery_mode == dest_Fixed ||
> - irq->delivery_mode == dest_LowestPrio);
> + return (irq->delivery_mode == APIC_DM_FIXED ||
> + irq->delivery_mode == APIC_DM_LOWEST);
> }
>
> static inline void kvm_arch_vcpu_blocking(struct kvm_vcpu *vcpu)
I confirm that this patch fixes AVIC posted interrupts on my 3970X.
Low byte of the delivery mode is the vector, while high byte is the
delivery mode, and the vector is masked in
kvm_set_msi_irq, thus indeed the delivery mode is in high 8 bytes.
Reviewed-by: Maxim Levitsky <mlevitsk@redhat.com>
Tested-by: Maxim Levitsky <mlevitsk@redhat.com>
Best regards,
Maxim Levitsky
next prev parent reply other threads:[~2020-05-02 13:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-07 6:13 Suravee Suthikulpanit
2020-04-30 17:44 ` Suravee Suthikulpanit
2020-05-02 13:13 ` Maxim Levitsky [this message]
2020-05-04 16:17 ` Paolo Bonzini
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=35c7c404406729dc05d0977c9d322655f2b1c4a9.camel@redhat.com \
--to=mlevitsk@redhat.com \
--cc=graf@amazon.com \
--cc=jon.grimm@amd.com \
--cc=joro@8bytes.org \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pbonzini@redhat.com \
--cc=suravee.suthikulpanit@amd.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
all inboxes | Powered by JetHome®