qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ioapic: clear irq_eoi when updating the ioapic redirect table entry
@ 2019-06-24 15:16 Li Qiang
  2019-06-25  2:29 ` Peter Xu
  2019-06-25  8:01 ` Paolo Bonzini
  0 siblings, 2 replies; 3+ messages in thread
From: Li Qiang @ 2019-06-24 15:16 UTC (permalink / raw)
  To: peterx, mst, pbonzini; +Cc: Li Qiang, liq3ea, qemu-devel

irq_eoi is used to count the number of irq injected during eoi
broadcast. It should be set to 0 when updating the ioapic's redirect
table entry.

Suggested-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Li Qiang <liq3ea@163.com>
---
 hw/intc/ioapic.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
index 7074489fdf..db9e518602 100644
--- a/hw/intc/ioapic.c
+++ b/hw/intc/ioapic.c
@@ -380,6 +380,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
                 /* restore RO bits */
                 s->ioredtbl[index] &= IOAPIC_RW_BITS;
                 s->ioredtbl[index] |= ro_bits;
+                s->irq_eoi[index] = 0;
                 ioapic_fix_edge_remote_irr(&s->ioredtbl[index]);
                 ioapic_service(s);
             }
-- 
2.17.1




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

* Re: [Qemu-devel] [PATCH] ioapic: clear irq_eoi when updating the ioapic redirect table entry
  2019-06-24 15:16 [Qemu-devel] [PATCH] ioapic: clear irq_eoi when updating the ioapic redirect table entry Li Qiang
@ 2019-06-25  2:29 ` Peter Xu
  2019-06-25  8:01 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Xu @ 2019-06-25  2:29 UTC (permalink / raw)
  To: Li Qiang; +Cc: pbonzini, liq3ea, qemu-devel, mst

On Mon, Jun 24, 2019 at 08:16:35AM -0700, Li Qiang wrote:
> irq_eoi is used to count the number of irq injected during eoi
> broadcast. It should be set to 0 when updating the ioapic's redirect
> table entry.
> 
> Suggested-by: Peter Xu <peterx@redhat.com>
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
>  hw/intc/ioapic.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
> index 7074489fdf..db9e518602 100644
> --- a/hw/intc/ioapic.c
> +++ b/hw/intc/ioapic.c
> @@ -380,6 +380,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
>                  /* restore RO bits */
>                  s->ioredtbl[index] &= IOAPIC_RW_BITS;
>                  s->ioredtbl[index] |= ro_bits;
> +                s->irq_eoi[index] = 0;

It'll be cleared for twice for each ioapic entry because it only
supports 32bit write to these registers.  Though it seems fine, e.g.,
when the guest only want to update the vector info we should still
clear it:

Reviewed-by: Peter Xu <peterx@redhat.com>

>                  ioapic_fix_edge_remote_irr(&s->ioredtbl[index]);
>                  ioapic_service(s);
>              }
> -- 
> 2.17.1
> 
> 

Regards,

-- 
Peter Xu


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

* Re: [Qemu-devel] [PATCH] ioapic: clear irq_eoi when updating the ioapic redirect table entry
  2019-06-24 15:16 [Qemu-devel] [PATCH] ioapic: clear irq_eoi when updating the ioapic redirect table entry Li Qiang
  2019-06-25  2:29 ` Peter Xu
@ 2019-06-25  8:01 ` Paolo Bonzini
  1 sibling, 0 replies; 3+ messages in thread
From: Paolo Bonzini @ 2019-06-25  8:01 UTC (permalink / raw)
  To: Li Qiang, peterx, mst; +Cc: liq3ea, qemu-devel

On 24/06/19 17:16, Li Qiang wrote:
> irq_eoi is used to count the number of irq injected during eoi
> broadcast. It should be set to 0 when updating the ioapic's redirect
> table entry.
> 
> Suggested-by: Peter Xu <peterx@redhat.com>
> Signed-off-by: Li Qiang <liq3ea@163.com>
> ---
>  hw/intc/ioapic.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/hw/intc/ioapic.c b/hw/intc/ioapic.c
> index 7074489fdf..db9e518602 100644
> --- a/hw/intc/ioapic.c
> +++ b/hw/intc/ioapic.c
> @@ -380,6 +380,7 @@ ioapic_mem_write(void *opaque, hwaddr addr, uint64_t val,
>                  /* restore RO bits */
>                  s->ioredtbl[index] &= IOAPIC_RW_BITS;
>                  s->ioredtbl[index] |= ro_bits;
> +                s->irq_eoi[index] = 0;
>                  ioapic_fix_edge_remote_irr(&s->ioredtbl[index]);
>                  ioapic_service(s);
>              }
> 

Queued, thanks.

Paolo


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

end of thread, other threads:[~2019-06-25  8:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-24 15:16 [Qemu-devel] [PATCH] ioapic: clear irq_eoi when updating the ioapic redirect table entry Li Qiang
2019-06-25  2:29 ` Peter Xu
2019-06-25  8:01 ` 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).