qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] [KVM] Needless to update msi route when only msi-x entry "control" section changed
@ 2013-05-04  9:12 Zhanghaoyu (A)
  2013-05-05 21:13 ` Michael S. Tsirkin
  0 siblings, 1 reply; 7+ messages in thread
From: Zhanghaoyu (A) @ 2013-05-04  9:12 UTC (permalink / raw)
  To: qemu-devel, Marcelo Tosatti
  Cc: Qinchuanyu, Luonengjun, Zanghongyong, Huangweidong (C)

With regard to old version linux guest(e.g., rhel-5.5), in ISR processing, mask and unmask msi-x vector every time, which result in VMEXIT, then QEMU will invoke kvm_irqchip_update_msi_route() to ask KVM hypervisor to update the VM irq routing table. In KVM hypervisor, synchronizing RCU needed after updating routing table, so much time consumed for waiting in wait_rcu_gp(). So CPU usage in VM is so high, while from the view of host, VM's total CPU usage is so low. 
Masking/unmasking msi-x vector only set msi-x entry "control" section, needless to update VM irq routing table.

Signed-off-by: Zhang Haoyu <haoyu.zhang@huawei.com>
Signed-off-by: Huang Weidong <weidong.huang@huawei.com>
Signed-off-by: Qin Chuanyu <qinchuanyu@huawei.com>
---
hw/i386/kvm/pci-assign.c | 3 +++
1 files changed, 3 insertions(+)

--- a/hw/i386/kvm/pci-assign.c  2013-05-04 15:53:18.000000000 +0800
+++ b/hw/i386/kvm/pci-assign.c  2013-05-04 15:50:46.000000000 +0800
@@ -1576,6 +1576,8 @@ static void assigned_dev_msix_mmio_write
                 MSIMessage msg;
                 int ret;

+                /* Needless to update msi route when only msi-x entry "control" section changed */
+                if ((addr & (PCI_MSIX_ENTRY_SIZE - 1)) != PCI_MSIX_ENTRY_VECTOR_CTRL){
                 msg.address = entry->addr_lo |
                     ((uint64_t)entry->addr_hi << 32);
                 msg.data = entry->data;
@@ -1585,6 +1587,7 @@ static void assigned_dev_msix_mmio_write
                 if (ret) {
                     error_report("Error updating irq routing entry (%d)", ret);
                 }
+                }
             }
         }
     }

Thanks,
Zhang Haoyu

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

end of thread, other threads:[~2013-05-12 11:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-04  9:12 [Qemu-devel] [PATCH] [KVM] Needless to update msi route when only msi-x entry "control" section changed Zhanghaoyu (A)
2013-05-05 21:13 ` Michael S. Tsirkin
2013-05-06  2:52   ` Zhanghaoyu (A)
2013-05-06 10:00     ` Michael S. Tsirkin
2013-05-07  1:53       ` Zhanghaoyu (A)
2013-05-12 11:48         ` Michael S. Tsirkin
2013-05-12 10:58       ` Michael S. Tsirkin

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).