--- a/xen/arch/x86/hvm/vmsi.c +++ b/xen/arch/x86/hvm/vmsi.c @@ -276,6 +276,7 @@ static int msixtbl_write(struct vcpu *v, if ( !entry ) goto out; nr_entry = (address - entry->gtable) / PCI_MSIX_ENTRY_SIZE; +printk("%pv: write MSI-X#%u: [%lx]=%0*lx\n", v, nr_entry, address, (int)len * 2, val);//temp offset = address & (PCI_MSIX_ENTRY_SIZE - 1); if ( offset != PCI_MSIX_ENTRY_VECTOR_CTRL_OFFSET ) @@ -321,7 +322,17 @@ static int msixtbl_write(struct vcpu *v, ASSERT(msi_desc == desc->msi_desc); +{//temp + bool_t h = msi_desc->msi_attrib.host_masked; + bool_t g = msi_desc->msi_attrib.guest_masked; + bool_t ha = entry->pdev->msix->host_maskall; + bool_t ga = entry->pdev->msix->guest_maskall; guest_mask_msi_irq(desc, !!(val & PCI_MSIX_VECTOR_BITMASK)); + printk("%pv: MSI-X#%u %d(%d) / %d(%d) -> %d(%d) / %d(%d)\n", + v, nr_entry, h, ha, g, ga, + msi_desc->msi_attrib.host_masked, entry->pdev->msix->host_maskall, + msi_desc->msi_attrib.guest_masked, entry->pdev->msix->guest_maskall); +} unlock: spin_unlock_irqrestore(&desc->lock, flags); @@ -330,6 +341,7 @@ unlock: out: rcu_read_unlock(&msixtbl_rcu_lock); +printk("%pv: write MSI-X [%lx] -> %d\n", v, address, r);//temp return r; } --- a/xen/arch/x86/msi.c +++ b/xen/arch/x86/msi.c @@ -438,6 +438,10 @@ static bool_t msi_set_mask_bit(struct ir if ( likely(control & PCI_MSIX_FLAGS_ENABLE) ) break; +if(pdev->info.is_virtfn) {//temp + printk("%04x:%02x:%02x.%o#%u: %d/%d >> %d/%d [%p]\n", seg, bus, slot, func, entry->msi_attrib.entry_nr, + entry->msi_attrib.host_masked, entry->msi_attrib.guest_masked, host, guest, __builtin_return_address(0)); +} entry->msi_attrib.host_masked = host; entry->msi_attrib.guest_masked = guest; @@ -1305,6 +1309,11 @@ int pci_msi_conf_write_intercept(struct pdev->msix->guest_maskall = !!(*data & PCI_MSIX_FLAGS_MASKALL); if ( pdev->msix->host_maskall ) *data |= PCI_MSIX_FLAGS_MASKALL; +if(pdev->info.is_virtfn) {//temp + printk("%04x:%02x:%02x.%o: ctrl -> %04x (d%d:%lx,d%d)\n", seg, bus, slot, func, + (uint16_t)*data, current->domain->domain_id, guest_cpu_user_regs()->eip, + pdev->domain ? pdev->domain->domain_id : -1); +} return 1; }