Re: [PATCH] VSOCK: define VSOCK_SS_LISTEN once only

2015-11-01 Thread David Miller
From: Stefan Hajnoczi Date: Thu, 29 Oct 2015 11:57:42 + > The SS_LISTEN socket state is defined by both af_vsock.c and > vmci_transport.c. This is risky since the value could be changed in one > file and the other would be out of sync. > > Rename from SS_LISTEN to

[PATCH 1/7] standard-headers/x86: add Hyper-V SynIC constants

2015-11-01 Thread Andrey Smetanin
Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Vitaly Kuznetsov CC: "K. Y. Srinivasan" CC: Gleb Natapov CC: Paolo Bonzini

[kvm-unit-tests PATCH] x86: hyperv_synic: Hyper-V SynIC test

2015-11-01 Thread Andrey Smetanin
Hyper-V SynIC is a Hyper-V synthetic interrupt controller. The test runs on every vCPU and performs the following steps: * read from all Hyper-V SynIC MSR's * setup Hyper-V SynIC evt/msg pages * setup SINT's routing * inject SINT's into destination vCPU by 'hyperv-synic-test-device' * wait for

[PATCH v4 3/6] virtio_pci: Use the DMA API

2015-11-01 Thread Andy Lutomirski
This fixes virtio-pci on platforms and busses that have IOMMUs. This will break the experimental QEMU Q35 IOMMU support until QEMU is fixed. In exchange, it fixes physical virtio hardware as well as virtio-pci running under Xen. We should clean up the virtqueue API to do its own allocation and

[PATCH v4 6/6] virtio_pci: Use the DMA API

2015-11-01 Thread Andy Lutomirski
This switches to vring_create_virtqueue, simplifying the driver and adding DMA API support. Signed-off-by: Andy Lutomirski --- drivers/virtio/virtio_pci_common.h | 7 - drivers/virtio/virtio_pci_legacy.c | 39 +++- drivers/virtio/virtio_pci_modern.c |

[PATCH v4 5/6] virtio_mmio: Use the DMA API

2015-11-01 Thread Andy Lutomirski
This switches to vring_create_virtqueue, simplifying the driver and adding DMA API support. Signed-off-by: Andy Lutomirski --- drivers/virtio/virtio_mmio.c | 67 ++-- 1 file changed, 15 insertions(+), 52 deletions(-) diff --git

Re: [PATCH v3 0/3] virtio DMA API core stuff

2015-11-01 Thread Joerg Roedel
On Thu, Oct 29, 2015 at 11:01:41AM +0200, Michael S. Tsirkin wrote: > Example: you have a mix of assigned devices and virtio devices. You > don't trust your assigned device vendor not to corrupt your memory so > you want to limit the damage your assigned device can do to your guest, > so you use

[PATCH v4 4/6] virtio: Add improved queue allocation API

2015-11-01 Thread Andy Lutomirski
This leaves vring_new_virtqueue alone for compatbility, but it adds two new improved APIs: vring_create_virtqueue: Creates a virtqueue backed by automatically allocated coherent memory. (Some day it this could be extended to support non-coherent memory, too, if there ends up being a platform on

[PATCH v3 3/3] virtio_pci: Use the DMA API

2015-11-01 Thread Andy Lutomirski
This fixes virtio-pci on platforms and busses that have IOMMUs. This will break the experimental QEMU Q35 IOMMU support until QEMU is fixed. In exchange, it fixes physical virtio hardware as well as virtio-pci running under Xen. We should clean up the virtqueue API to do its own allocation and

[PATCH v2 1/3] virtio_net: Stop doing DMA from the stack

2015-11-01 Thread Andy Lutomirski
From: Andy Lutomirski Once virtio starts using the DMA API, we won't be able to safely DMA from the stack. virtio-net does a couple of config DMA requests from small stack buffers -- switch to using dynamically-allocated memory. This should have no effect on any

[PATCH v4 0/6] virtio core DMA API conversion

2015-11-01 Thread Andy Lutomirski
This switches virtio to use the DMA API unconditionally. I'm sure it breaks things, but it seems to work on x86 using virtio-pci, with and without Xen, and using both the modern 1.0 variant and the legacy variant. This appears to work on native and Xen x86_64 using both modern and legacy

[PATCH v3 1/3] virtio_net: Stop doing DMA from the stack

2015-11-01 Thread Andy Lutomirski
From: Andy Lutomirski Once virtio starts using the DMA API, we won't be able to safely DMA from the stack. virtio-net does a couple of config DMA requests from small stack buffers -- switch to using dynamically-allocated memory. This should have no effect on any

[PATCH v3 2/3] virtio_ring: Support DMA APIs

2015-11-01 Thread Andy Lutomirski
virtio_ring currently sends the device (usually a hypervisor) physical addresses of its I/O buffers. This is okay when DMA addresses and physical addresses are the same thing, but this isn't always the case. For example, this never works on Xen guests, and it is likely to fail if a physical

[PATCH v3 0/3] virtio DMA API core stuff

2015-11-01 Thread Andy Lutomirski
This switches virtio to use the DMA API unconditionally. I'm sure it breaks things, but it seems to work on x86 using virtio-pci, with and without Xen, and using both the modern 1.0 variant and the legacy variant. Changes from v2: - Fix really embarrassing bug. This version actually works.

[PATCH 0/7] Hyper-V Synthetic interrupt controller

2015-11-01 Thread Andrey Smetanin
Hyper-V SynIC (synthetic interrupt controller) device implementation. The implementation contains: * msr's support * irq routing setup * irq injection * irq ack callback registration * event/message pages changes tracking at Hyper-V exit * Hyper-V test device to test SynIC by kvm-unit-tests

[PATCH 7/7] hw/misc: Hyper-V test device 'hyperv-testdev'

2015-11-01 Thread Andrey Smetanin
'hyperv-testdev' will be used by kvm-unit-tests to setup Hyper-V SynIC SINT's routing and to inject Hyper-V SynIC SINT's. Hyper-V test device is ISA type device that create 0x3000 IO memory region and catches write access into it. Every write operation data decoded into ctl code and parameters

[PATCH 6/7] target-i386/hyperv: Hyper-V SynIC SINT routing and vCPU exit

2015-11-01 Thread Andrey Smetanin
Hyper-V SynIC(synthetic interrupt controller) API for irq routing setup, irq injection, irq ack notifications and event/message pages changes tracking for future use. Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by: Denis V.

[PATCH 2/7] target-i386/kvm: Hyper-V SynIC MSR's support

2015-11-01 Thread Andrey Smetanin
Hyper-V SynIC MSR's support and MSR's migration. Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Vitaly Kuznetsov CC: "K. Y. Srinivasan" CC: Gleb

[PATCH 3/7] linux-headers/kvm: add Hyper-V SynIC irq routing type and struct

2015-11-01 Thread Andrey Smetanin
Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Vitaly Kuznetsov CC: "K. Y. Srinivasan" CC: Gleb Natapov CC: Paolo Bonzini

[PATCH 4/7] kvm: Hyper-V SynIC irq routing support

2015-11-01 Thread Andrey Smetanin
Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Vitaly Kuznetsov CC: "K. Y. Srinivasan" CC: Gleb Natapov CC: Paolo Bonzini

[PATCH 5/7] linux-headers/kvm: KVM_EXIT_HYPERV type and struct

2015-11-01 Thread Andrey Smetanin
Signed-off-by: Andrey Smetanin Reviewed-by: Roman Kagan Signed-off-by: Denis V. Lunev CC: Vitaly Kuznetsov CC: "K. Y. Srinivasan" CC: Gleb Natapov CC: Paolo Bonzini