On Wed, Jul 24, 2013 at 11:08:43AM +0800, Zhenzhong Duan wrote:I think it's better to remove the for loop for dom0, also hard to know when to clear hypercall count.PHYSDEVOP_restore_msi is used to restore all msix entrys in one hypercallCouldn't the restore_msi_irqs instead check whether it has already
in dom0. But it is called multi times in current code.
made the hypercall (perhaps by seeing if the MSI-X's are enabled?)
and if so don't do the hypercall?
We have x86_msi.restore_msi_irqs and no x86_msi.restore_msi_irq,if want to
I think you are addressing the problem from a different viewpoint.
The problem is not with the API (the x86_msi one). The problem
is with the implementation (x86_msi.restore_msi_irq - specifically
the Xen one) having an side effect.
Yes, This patch just did that. There is teardown_msi_irqs/teardown_msi_irq pair.
This patch split arch_restore_msi_irqs into two functions.But irregardless of how you address the problem, this in the MSI code
Use arch_restore_msi_irq deal with one entry and avoid call hypercall multi
times in __pci_restore_msix_state.
is a bit odd:
list_for_each_entry(entry, &dev->msi_list, list) {
arch_restore_msi_irqs(dev, entry->irq);
}
and if you collapse that and make the 'arch_restore_msi_irqs' be responsible
for doing all the heavy lifting.. That does seem an improvement on the API
and will make it inline with 'teardown_msi_irqs'.
So from that view I think it would be nicer?