Re: [Patch v5] x86: irq_comm: Add check for RH bit in kvm_set_msi_irq

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/19/2015 07:00 AM, Radim Krčmář wrote:
> 2015-03-18 22:09-0300, Marcelo Tosatti:
>>>> See native_compose_msi_msg:
>>>>                 ((apic->irq_dest_mode == 0) ?
>>>>                         MSI_ADDR_DEST_MODE_PHYSICAL :
>>>>                         MSI_ADDR_DEST_MODE_LOGICAL) |
>>>>                 ((apic->irq_delivery_mode != dest_LowestPrio) ?
>>>>                         MSI_ADDR_REDIRECTION_CPU :
>>>>                         MSI_ADDR_REDIRECTION_LOWPRI) |
>>>> So it does configure DM = MSI_ADDR_DEST_MODE_LOGICAL
>>>> and RH = MSI_ADDR_REDIRECTION_LOWPRI.
>>> ...and yet this is a good counterexample against my argument :)
> 
> (It could be just to make the code nicer ... the developer might have
>  known how real hardware will handle it.)
> 
>>> What I think I'll do is revert this particular change so that dest_mode is
>>> set independently of RH. While I'm not entirely convinced that this is the
>>> intended interpretation, I do think that consistency with the existing logic
>>> is probably desirable for the time being. If I can get closure on the matter
>>> I'll re-submit that change, but for the time being I will undo it.
>> Just write MSI-X table entries on real hardware (say: modify
>> native_compose_msi_msg or MSI-X equivalent), with all RH/DM
>> combinations, and see what behaviour is
>> comes up?  
> 
> I second this idea.
> (We'd also get to know how RH interacts with delivery mode.)
> 

I played around with native_compose_msi_msg and discovered the following:

* dm=0, rh=0 => Physical Destination Mode
* dm=0, rh=1 => Failed delivery
* dm=1, rh=0 => Logical Destination Mode, No Redirection
* dm=1, rh=1 => Logical Destination Mode, Redirection

So it seems to be the case that logical destination mode is used whenever
DM=1, regardless of RH. Furthermore, the case where DM=0 and RH=1 is
undefined, as was indicated in the closing response to the thread in
https://software.intel.com/en-us/forums/topic/288883 :

"...X86 supports logical mode but does not support redirection of physical mode
interrupts. I think they should have just said RH=1 is not defined in physical
mode, but instead they are trying to tell you what the restrictions are if you
set it on."

The default config for PCI devices seems to be DM=1,RH=1.

-James
--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux