On 05.07.2016 22:51, Jan Kiszka wrote:
> On 2016-07-05 13:21, Valentine Sinitsyn wrote:
>> Hi all,
>>
>> I faced a strange issue regarding MSI-X on my board.
>>
>> A USB host (xchi_hcd) enables 5 MSI-X vectors out of 8.
>>
>> The problem is other three vectors remain unmasked (at least, according
>> to dev->msi_vectors in Jailhouse), even if they store all-zeros. The PCI
>
> (you mean dev->msix_vectors, I suppose)
Sure, dev->msix_vectors.
>
>> spec says all vectors must be masked on reset (which sounds sane).
>>
>> What's this? A bug in the kernel/driver? A config issue? Has anyone
>> tested Jailhouse in conjunction with MSI-X?
>
> Yes, in various setups. Worked fine so far.
>
> What is the exact problem you see? Does Jailhouse fail when enabling,
> thus trying to migrate those vectors to remapped mode?
Yes. When iommu_map_interrupt() tries to validate these all-zero
entries, it fails. This is expected, of course, but the precise reason
is destination CPU 0 (all-zeros entry obviously can't reference anything
else) doesn't exists on this board.
The expected behavior would be not to remap these entries, of course.
However, they aren't masked (which is what I'd expect), and adding
another "address != 0" check seems like a hack.
Valentine