Re: [PATCH v2 2/3] pci-assign: Use PCI-2.3-based shared legacy interrupts

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

 



On Wed, 2012-03-07 at 19:05 +0100, Jan Kiszka wrote:
> Enable the new KVM feature that allows legacy interrupt sharing for
> PCI-2.3-compliant devices. This requires to synchronize any guest
> change of the INTx mask bit to the kernel.
> 
> The feature is controlled by the property 'share_intx' and is off by
> default for now.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@xxxxxxxxxxx>
> ---
> 
> Changes in v2:
>  - only call into kvm_device_intx_set_mask if the mask actually changed
> 
>  hw/device-assignment.c |   24 ++++++++++++++++++++++++
>  hw/device-assignment.h |   10 ++++++----
>  qemu-kvm.c             |    9 +++++++++
>  qemu-kvm.h             |    2 ++
>  4 files changed, 41 insertions(+), 4 deletions(-)
> 
> diff --git a/hw/device-assignment.c b/hw/device-assignment.c
> index a5f1abb..12e2195 100644
> --- a/hw/device-assignment.c
> +++ b/hw/device-assignment.c
> @@ -782,6 +782,13 @@ static int assign_device(AssignedDevice *dev)
>                  "cause host memory corruption if the device issues DMA write "
>                  "requests!\n");
>      }
> +    if (dev->features & ASSIGNED_DEVICE_SHARE_INTX_MASK) {
> +        assigned_dev_data.flags |= KVM_DEV_ASSIGN_PCI_2_3;
> +
> +        /* hide host-side INTx masking from the guest */
> +        dev->emulate_config_read[PCI_COMMAND + 1] |=
> +            PCI_COMMAND_INTX_DISABLE >> 8;
> +    }
>  
>      r = kvm_assign_pci_device(kvm_state, &assigned_dev_data);
>      if (r < 0) {
> @@ -1121,10 +1128,25 @@ static void assigned_dev_pci_write_config(PCIDevice *pci_dev, uint32_t address,
>                                            uint32_t val, int len)
>  {
>      AssignedDevice *assigned_dev = DO_UPCAST(AssignedDevice, dev, pci_dev);
> +    uint32_t old_cmd = pci_get_word(pci_dev->config + PCI_COMMAND);

nit, uint16_t


--
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