On 06/01/2016 04:39 PM, Markus Armbruster wrote:
Cao jin <caoj.f...@cn.fujitsu.com> writes: Not covered: static void intel_hda_update_irq(IntelHDAState *d) { --> int msi = d->msi && msi_enabled(&d->pci); int level; intel_hda_update_int_sts(d); if (d->int_sts & (1U << 31) && d->int_ctl & (1U << 31)) { level = 1; } else { level = 0; } dprint(d, 2, "%s: level %d [%s]\n", __FUNCTION__, level, msi ? "msi" : "intx"); if (msi) { if (level) { msi_notify(&d->pci, 0); } } else { pci_set_irq(&d->pci, level); } } This is wrong, because the meaning of the test changes from (user didn't specify msi=off) && (guest enabled MSI) to (user didn't specify msi=on or msi=off) && (guest enabled MSI)
Thanks for pointing the error, seems I lost the fact that ON_OFF_AUTO_AUTO equals 0.
What about: int msi = msi_enabled(&d->pci); If I understand it correctly, it can only be true when we added MSI capability, and we do that only when msi=auto (default) or msi=on.
I think the modification is ok. -- Yours Sincerely, Cao jin