Re: [PATCH 0/5] kvm: memslots lookup optimization

2014-12-02 Thread Igor Mammedov
On Mon, 01 Dec 2014 18:38:34 +0100 Paolo Bonzini wrote: > > > On 01/12/2014 18:29, Igor Mammedov wrote: > > Series speed-ups GFN to memslot lookup time by: > > * introducing LRU cache, which improves looukup time for > >same slot workload (typically boot time of Windows and Linux guest) >

Re: [PATCH v2 2/2] kvm: vmx: enable intel xsaves for guest

2014-12-02 Thread Paolo Bonzini
On 02/12/2014 07:14, Wanpeng Li wrote: > Expose intel xsaves feature to guest. > > Signed-off-by: Wanpeng Li > --- > v1 -> v2: > *auto switch msr ia32_xss if this msr is present > > arch/x86/include/asm/kvm_host.h | 1 + > arch/x86/include/asm/vmx.h | 3 +++ > arch/x86/include/uapi/as

Re: [PATCH v2 1/2] kvm: x86: revert mask out xsaves

2014-12-02 Thread Paolo Bonzini
On 02/12/2014 07:14, Wanpeng Li wrote: > xsaves will be exported to guest in the next patch, so revert the > mask out xsaves patch. > > Signed-off-by: Wanpeng Li > --- > arch/x86/kvm/cpuid.c | 10 +- > 1 file changed, 1 insertion(+), 9 deletions(-) > > diff --git a/arch/x86/kvm/cpuid.

Re: [PATCH v2 2/2] kvm: vmx: enable intel xsaves for guest

2014-12-02 Thread Wanpeng Li
Hi Paolo, On Tue, Dec 02, 2014 at 09:51:22AM +0100, Paolo Bonzini wrote: > > >On 02/12/2014 07:14, Wanpeng Li wrote: >> Expose intel xsaves feature to guest. >> >> Signed-off-by: Wanpeng Li >> --- >> v1 -> v2: >> *auto switch msr ia32_xss if this msr is present >> >> arch/x86/include/asm/kvm_h

Re: [PATCH v2 1/2] kvm: x86: revert mask out xsaves

2014-12-02 Thread Wanpeng Li
On Tue, Dec 02, 2014 at 09:55:09AM +0100, Paolo Bonzini wrote: > > >On 02/12/2014 07:14, Wanpeng Li wrote: >> xsaves will be exported to guest in the next patch, so revert the >> mask out xsaves patch. >> >> Signed-off-by: Wanpeng Li >> --- >> arch/x86/kvm/cpuid.c | 10 +- >> 1 file chan

[qemu] virtio drivers implementation details

2014-12-02 Thread Vasile Catalin-B50542
Hi, I'm trying to develop a custom virtio driver for myself. Can I ask here virtio driver implementation details? I've tried the kvm and qemu irc channel, but had no luck. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More

Re: [Xen-devel] [PATCH] xen: privcmd: schedule() after private hypercall when non CONFIG_PREEMPT

2014-12-02 Thread David Vrabel
On 01/12/14 22:36, Luis R. Rodriguez wrote: > > Then I do agree its a fair analogy (and find this obviously odd that how > widespread cond_resched() is), we just don't have an equivalent for IRQ > context, why not avoid the special check then and use this all the time in the > middle of a hypercal

[PATCH v3 0/3] kvm: vmx: enable xsaves for kvm

2014-12-02 Thread Wanpeng Li
This patchset is to enable xsaves for kvm part, the patch for qemu part will be sent out later. The patchset is tested on skylake-client. v2 -> v3: * add kvm_get/set for ia32_xss * fix the type XSS_EXIT_BITMAP * load host_xss just once in setup_vmcs_config * add/clear atuo switch ia32_xss m

[PATCH v3 2/3] kvm: vmx: add kvm_get/set logic to xsaves

2014-12-02 Thread Wanpeng Li
Add kvm_get/set logic to xsaves. Signed-off-by: Wanpeng Li --- arch/x86/kvm/vmx.c | 20 1 file changed, 20 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 12915f1..66d1e3d 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -99,6 +99,8 @@ m

[PATCH v3 1/3] kvm: x86: Intel XSAVES vmx and msr handle

2014-12-02 Thread Wanpeng Li
Intel xsaves vmx and msr handle. Signed-off-by: Wanpeng Li --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/include/asm/vmx.h | 3 +++ arch/x86/include/uapi/asm/vmx.h | 6 +- arch/x86/kvm/vmx.c | 31 ++- 4 files changed, 40 insertions(+),

[PATCH v3 3/3] kvm: x86: Enable Intel XSAVES for guest

2014-12-02 Thread Wanpeng Li
Exporse intel xsaves feature to guest. Signed-off-by: Wanpeng Li --- arch/x86/kvm/cpuid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index a4f5ac4..0d919bc 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -267,

Re: [qemu] virtio drivers implementation details

2014-12-02 Thread Vasile Catalin-B50542
This is the link to the presentation: http://www.slideshare.net/zenixls2/052-virtio-introduction-17191942 -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [qemu] virtio drivers implementation details

2014-12-02 Thread Vasile Catalin-B50542
I'm trying to make a custom virtio driver that mostly interacts with memory. I've came upon a presentation which shows which files need to be edited on qemu and kvm in order to add a new virtio driver. One of the files in qemu is include/hw/pci/pci.h, but that was an example specific to virtio p

usb audio device troubles

2014-12-02 Thread Eric S. Johansson
I got win7 installed, virtio devices working and took forever to trickle in updates because of a w7 bug update manager bug that take up all cpu resources. now I got DNS 13 installed but I'm getting no audio. I pass throught the usb audio device (logitech h800 USB 046d:0a29) and it is seen as

[PATCH] target-i386: Intel xsaves

2014-12-02 Thread Wanpeng Li
Add xsaves related definition, it also add corresponding part to kvm_get/put, and vmstate. Signed-off-by: Wanpeng Li --- target-i386/cpu.h | 2 ++ target-i386/kvm.c | 15 +++ target-i386/machine.c | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/targ

Re: [PATCH] target-i386: Intel xsaves

2014-12-02 Thread Paolo Bonzini
On 02/12/2014 13:19, Wanpeng Li wrote: > Add xsaves related definition, it also add corresponding part to > kvm_get/put, and vmstate. > > Signed-off-by: Wanpeng Li > --- > target-i386/cpu.h | 2 ++ > target-i386/kvm.c | 15 +++ > target-i386/machine.c | 3 ++- > 3 files

Re: usb audio device troubles

2014-12-02 Thread Paolo Bonzini
On 02/12/2014 13:16, Eric S. Johansson wrote: > I got win7 installed, virtio devices working and took forever to trickle > in updates because of a w7 bug update manager bug that take up all cpu > resources. now I got DNS 13 installed but I'm getting no audio. > > I pass throught the usb audio d

[PATCH RFC v5 00/19] qemu: towards virtio-1 host support

2014-12-02 Thread Cornelia Huck
Another iteration of virtio-1 patches for qemu, as always available on git://github.com/cohuck/qemu virtio-1 This one seems to work together with the current vhost-next patches (well, I can ping :) Changes from v4: - add helpers for feature bit manipulation and checking - use 64 bit feature bits

[PATCH RFC v5 16/19] virtio-net: support longer header

2014-12-02 Thread Cornelia Huck
virtio-1 devices always use num_buffers in the header, even if mergeable rx buffers have not been negotiated. Signed-off-by: Cornelia Huck --- hw/net/virtio-net.c | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.

[PATCH RFC v5 17/19] virtio-net: enable virtio 1.0

2014-12-02 Thread Cornelia Huck
virtio-net (non-vhost) now should have everything in place to support virtio 1.0: let's enable the feature bit for it. Note that VIRTIO_F_VERSION_1 is technically a transport feature; once every device is ready for virtio 1.0, we can move setting this feature bit out of the individual devices. Si

[PATCH RFC v5 19/19] virtio-blk: revision specific feature bits

2014-12-02 Thread Cornelia Huck
Wire up virtio-blk to provide different feature bit sets depending on whether legacy or v1.0 has been requested. Note that VERSION_1 is still disabled due to missing ANY_LAYOUT support. Signed-off-by: Cornelia Huck --- hw/block/virtio-blk.c | 19 +++ 1 file changed, 19 inserti

[PATCH RFC v5 18/19] virtio: support revision-specific features

2014-12-02 Thread Cornelia Huck
Devices may support different sets of feature bits depending on which revision they're operating at. Let's give the transport a way to re-query the device about its features when the revision has been changed. Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c | 12 ++-- h

[PATCH RFC v5 06/19] virtio: endianness checks for virtio 1.0 devices

2014-12-02 Thread Cornelia Huck
Add code that checks for the VERSION_1 feature bit in order to make decisions about the device's endianness. This allows us to support transitional devices. Signed-off-by: Cornelia Huck --- hw/virtio/virtio.c|6 +- include/hw/virtio/virtio-access.h |4 include/hw

[PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout

2014-12-02 Thread Cornelia Huck
For virtio-1 devices, we allow a more complex queue layout that doesn't require descriptor table and rings on a physically-contigous memory area: add virtio_queue_set_rings() to allow transports to set this up. Signed-off-by: Cornelia Huck --- hw/virtio/virtio.c | 16

[PATCH RFC v5 12/19] virtio: disallow late feature changes for virtio-1

2014-12-02 Thread Cornelia Huck
For virtio-1 devices, the driver must not attempt to set feature bits after it set FEATURES_OK in the device status. Simply reject it in that case. Signed-off-by: Cornelia Huck --- hw/virtio/virtio.c | 16 ++-- include/hw/virtio/virtio.h |2 ++ 2 files changed, 16 inser

[PATCH RFC v5 09/19] s390x/css: Add a callback for when subchannel gets disabled

2014-12-02 Thread Cornelia Huck
From: Thomas Huth We need a possibility to run code when a subchannel gets disabled. This patch adds the necessary infrastructure. Signed-off-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/css.c | 12 hw/s390x/css.h |1 + 2 files changed, 13 insertions(+) diff -

[PATCH RFC v5 13/19] virtio: allow to fail setting status

2014-12-02 Thread Cornelia Huck
virtio-1 allow setting of the FEATURES_OK status bit to fail if the negotiated feature bits are inconsistent: let's fail virtio_set_status() in that case and update virtio-ccw to post an error to the guest. Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c | 20

[PATCH RFC v5 01/19] linux-headers/virtio_config: Update with VIRTIO_F_VERSION_1

2014-12-02 Thread Cornelia Huck
From: Thomas Huth Add the new VIRTIO_F_VERSION_1 definition to the virtio_config.h linux header. Signed-off-by: Thomas Huth Signed-off-by: Cornelia Huck --- linux-headers/linux/virtio_config.h |3 +++ 1 file changed, 3 insertions(+) diff --git a/linux-headers/linux/virtio_config.h b/lin

[PATCH RFC v5 15/19] virtio-net: no writeable mac for virtio-1

2014-12-02 Thread Cornelia Huck
Devices operating as virtio 1.0 may not allow writes to the mac address in config space. Signed-off-by: Cornelia Huck --- hw/net/virtio-net.c |1 + 1 file changed, 1 insertion(+) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index d6d1b98..ebbea60 100644 --- a/hw/net/virtio-net.c +

[PATCH RFC v5 10/19] s390x/virtio-ccw: add virtio set-revision call

2014-12-02 Thread Cornelia Huck
From: Thomas Huth Handle the virtio-ccw revision according to what the guest sets. When revision 1 is selected, we have a virtio-1 standard device with byteswapping for the virtio rings. When a channel gets disabled, we have to revert to the legacy behavior in case the next user of the device do

[PATCH RFC v5 11/19] s390x/virtio-ccw: support virtio-1 set_vq format

2014-12-02 Thread Cornelia Huck
Support the new CCW_CMD_SET_VQ format for virtio-1 devices. While we're at it, refactor the code a bit and enforce big endian fields (which had always been required, even for legacy). Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c | 114 +++

[PATCH RFC v5 03/19] virtio: feature bit manipulation helpers

2014-12-02 Thread Cornelia Huck
Add virtio_{add,clear}_feature helper functions for manipulating a feature bits variable. This has some benefits over open coding: - add check that the bit is in a sane range - make it obvious at a glance what is going on - have a central point to change when we want to extend feature bits Convert

[PATCH RFC v5 04/19] virtio: add feature checking helpers

2014-12-02 Thread Cornelia Huck
Add a helper function for checking whether a bit is set in the guest features for a vdev as well as one that works on a feature bit set. Convert code that open-coded this: It cleans up the code and makes it easier to extend the guest feature bits. Signed-off-by: Cornelia Huck --- hw/block/virti

[PATCH RFC v5 14/19] s390x/virtio-ccw: enable virtio 1.0

2014-12-02 Thread Cornelia Huck
virtio-ccw should now have everything in place to operate virtio 1.0 devices, so let's enable revision 1. Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.h |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/s390x/virtio-ccw.h b/hw/s390x/virtio-ccw.h index fe5c782..d40

[PATCH RFC v5 02/19] virtio: cull virtio_bus_set_vdev_features

2014-12-02 Thread Cornelia Huck
The only user of this function was virtio-ccw, and it should use virtio_set_features() like everybody else: We need to make sure that bad features are masked out properly, which this function did not do. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/virtio-ccw.c |

[PATCH RFC v5 05/19] virtio: support more feature bits

2014-12-02 Thread Cornelia Huck
With virtio-1, we support more than 32 feature bits. Let's extend both host and guest features to 64, which should suffice for a while. vhost and migration have been ignored for now. Signed-off-by: Cornelia Huck --- hw/9pfs/virtio-9p-device.c |2 +- hw/block/virtio-blk.c |

[PATCH RFC v5 08/19] dataplane: allow virtio-1 devices

2014-12-02 Thread Cornelia Huck
Handle endianness conversion for virtio-1 virtqueues correctly. Note that dataplane now needs to be built per-target. Signed-off-by: Cornelia Huck --- hw/block/dataplane/virtio-blk.c |4 +- hw/scsi/virtio-scsi-dataplane.c |2 +- hw/virtio/Makefile.objs

Re: [PATCH v3 0/3] kvm: vmx: enable xsaves for kvm

2014-12-02 Thread Paolo Bonzini
On 02/12/2014 12:14, Wanpeng Li wrote: > This patchset is to enable xsaves for kvm part, the patch for > qemu part will be sent out later. > > The patchset is tested on skylake-client. > > v2 -> v3: > * add kvm_get/set for ia32_xss > * fix the type XSS_EXIT_BITMAP > * load host_xss just on

[PATCH] KVM: cpuid: mask more bits in leaf 0xd and subleaves

2014-12-02 Thread Paolo Bonzini
- EAX=0Dh, ECX=1: output registers EBX/ECX/EDX are reserved. - EAX=0Dh, ECX>1: output register ECX is zero for all the CPUID leaves we support, because variable "supported" comes from XCR0 and not XSS. However, only bits above 0 are reserved. Output register EDX is reserved. Source: Intel Archit

Re: [PATCH 5/7] KVM: arm64: guest debug, add support for single-step

2014-12-02 Thread Christoffer Dall
On Mon, Dec 01, 2014 at 11:50:14AM +, Alex Bennée wrote: > > Christoffer Dall writes: > > > On Tue, Nov 25, 2014 at 04:10:03PM +, Alex Bennée wrote: > >> This adds support for single-stepping the guest. As userspace can and > >> will manipulate guest registers before restarting any tweak

Re: [PATCH 6/7] KVM: arm64: re-factor hyp.S debug register code

2014-12-02 Thread Christoffer Dall
On Mon, Dec 01, 2014 at 11:52:44AM +, Alex Bennée wrote: > > Christoffer Dall writes: > > > On Tue, Nov 25, 2014 at 04:10:04PM +, Alex Bennée wrote: > >> This is a pre-cursor to sharing the code with the guest debug support. > >> This replaces the big macro that fishes data out of a fixe

Re: [PATCH 0/5] kvm: memslots lookup optimization

2014-12-02 Thread Paolo Bonzini
On 02/12/2014 08:57, Igor Mammedov wrote: >> On 01/12/2014 18:29, Igor Mammedov wrote: >>> Series speed-ups GFN to memslot lookup time by: >>> * introducing LRU cache, which improves looukup time for >>>same slot workload (typically boot time of Windows and Linux guest) >>> * switching to b

Re: [PATCH 5/5] arm/arm64: KVM: Turn off vcpus and flush stage-2 pgtables on sytem exit events

2014-12-02 Thread Christoffer Dall
On Mon, Dec 01, 2014 at 05:57:53PM +, Peter Maydell wrote: > On 27 November 2014 at 23:10, Peter Maydell wrote: > > It seems odd to have this unmap happen on attempted system reset/powerdown, > > not on cpu init/start. > > Here's a concrete case that I think requires the unmap to be > done on

Re: Allocating dedicated RAM to host that guest can not use

2014-12-02 Thread Paolo Bonzini
On 27/11/2014 13:16, mad Engineer wrote: > a random thought can we set qemu user/group rss to a particular hard > limit in limits.conf Those apply per process, not per user/group. Paolo -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.

Re: [PATCH 1/5] arm/arm64: KVM: Correct KVM_ARM_VCPU_INIT power off option

2014-12-02 Thread Christoffer Dall
On Thu, Nov 27, 2014 at 10:44:29PM +, Peter Maydell wrote: > On 27 November 2014 at 18:40, Christoffer Dall > wrote: > > The implementation of KVM_ARM_VCPU_INIT is currently not doing what > > userspace expects, namely making sure that a vcpu which may have been > > turned off using PSCI is re

Re: [PATCH] x86, microcode: Don't initialize microcode code on paravirt

2014-12-02 Thread Boris Ostrovsky
On 12/01/2014 05:37 PM, Borislav Petkov wrote: On Mon, Dec 01, 2014 at 05:31:56PM -0500, Boris Ostrovsky wrote: I think so. The problem we have now is __pa() macro that we only use on 32-bit. I'll queue this for overnight tests to make sure and if it indeed works then 3.19 should be fine. Cool,

Re: [PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout

2014-12-02 Thread Michael S. Tsirkin
On Tue, Dec 02, 2014 at 02:00:15PM +0100, Cornelia Huck wrote: > For virtio-1 devices, we allow a more complex queue layout that doesn't > require descriptor table and rings on a physically-contigous memory area: > add virtio_queue_set_rings() to allow transports to set this up. > > Signed-off-by:

Re: [PATCH 3/5] arm/arm64: KVM: Clarify KVM_ARM_VCPU_INIT ABI

2014-12-02 Thread Christoffer Dall
On Thu, Nov 27, 2014 at 10:53:50PM +, Peter Maydell wrote: > On 27 November 2014 at 18:40, Christoffer Dall > wrote: > > It is not clear that this ioctl can be called multiple times for a given > > vcpu. Userspace already does this, so clarify the ABI. > > > > Signed-off-by: Christoffer Dall

Re: [PATCH 0/5] Improve PSCI system events and fix reboot bugs

2014-12-02 Thread Christoffer Dall
On Mon, Dec 01, 2014 at 02:34:12PM +0100, Andrew Jones wrote: > On Thu, Nov 27, 2014 at 07:40:55PM +0100, Christoffer Dall wrote: > > Several people have reported problems with rebooting ARM VMs, especially > > on 32-bit ARM. This is mainly due to the same reason we were seeing > > boot errors in

Re: [PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout

2014-12-02 Thread Cornelia Huck
On Tue, 2 Dec 2014 16:46:28 +0200 "Michael S. Tsirkin" wrote: > On Tue, Dec 02, 2014 at 02:00:15PM +0100, Cornelia Huck wrote: > > For virtio-1 devices, we allow a more complex queue layout that doesn't > > require descriptor table and rings on a physically-contigous memory area: > > add virtio_q

Re: [PATCH] x86, microcode: Don't initialize microcode code on paravirt

2014-12-02 Thread Borislav Petkov
On Tue, Dec 02, 2014 at 09:36:40AM -0500, Boris Ostrovsky wrote: > All tests passed. Thanks! > I wonder whether we should prevent all guests (not just paravirt) from > loading microcode driver (and from doing early microcode loading). I don't think the unmodified ones need to. At least I haven't

Re: [PATCH 5/5] arm/arm64: KVM: Turn off vcpus and flush stage-2 pgtables on sytem exit events

2014-12-02 Thread Christoffer Dall
On Thu, Nov 27, 2014 at 11:10:14PM +, Peter Maydell wrote: > On 27 November 2014 at 18:41, Christoffer Dall > wrote: > > When a vcpu calls SYSTEM_OFF or SYSTEM_RESET with PSCI v0.2, the vcpus > > should really be turned off for the VM adhering to the suggestions in > > the PSCI spec, and it's

Re: [PATCH 3/5] arm/arm64: KVM: Clarify KVM_ARM_VCPU_INIT ABI

2014-12-02 Thread Peter Maydell
On 2 December 2014 at 14:47, Christoffer Dall wrote: > On Thu, Nov 27, 2014 at 10:53:50PM +, Peter Maydell wrote: >> On 27 November 2014 at 18:40, Christoffer Dall >> wrote: >> > Possible features: >> > - KVM_ARM_VCPU_POWER_OFF: Starts the CPU in a power-off state. >> > Dep

Re: [PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout

2014-12-02 Thread Cornelia Huck
On Tue, 2 Dec 2014 15:54:44 +0100 Cornelia Huck wrote: > On Tue, 2 Dec 2014 16:46:28 +0200 > "Michael S. Tsirkin" wrote: > > pa == -1ULL tricks look quite ugly. > > Can't we set desc/avail/used unconditionally, and drop > > the pa value? > > And have virtio_queue_get_addr() return desc? Let me

Re: [PATCH 5/5] arm/arm64: KVM: Turn off vcpus and flush stage-2 pgtables on sytem exit events

2014-12-02 Thread Peter Maydell
On 2 December 2014 at 15:01, Christoffer Dall wrote: > On Thu, Nov 27, 2014 at 11:10:14PM +, Peter Maydell wrote: >> Also, the clarification we want here should not I think be architecture >> specific -- the handling of the exit system event in QEMU is in common >> code. What you want to say i

Re: [RFC PATCH v2 1/2] KVM: kvm-vfio: User API for VT-d Posted-Interrupts

2014-12-02 Thread Alex Williamson
On Tue, 2014-12-02 at 08:52 +0100, Eric Auger wrote: > On 12/02/2014 05:48 AM, Alex Williamson wrote: > > On Tue, 2014-12-02 at 02:08 +, Wu, Feng wrote: > >> > >>> -Original Message- > >>> From: Eric Auger [mailto:eric.au...@linaro.org] > >>> Sent: Monday, December 01, 2014 6:10 PM > >>

Re: [PATCH] KVM: Introduce dynamically registered hypercall capability

2014-12-02 Thread Radim Krčmář
(tl;dr version at the bottom) 2014-12-01 15:43-0800, Phil White: > On Mon, Dec 1, 2014 at 5:47 AM, Radim Krčmář wrote: > > 2014-11-28 17:29-0800, Phil White: > >> Good questions. > >> > >> One thing that prompted this code is the presence and proliferation of > >> architecture specific hypercalls

[PATCH] KVM: arm/arm64: vgic: add init entry to VGIC KVM device

2014-12-02 Thread Eric Auger
Since the advent of dynamic initialization of VGIC, this latter is initialized very late, on the first vcpu run. This initialization could be initiated much earlier by the user, as soon as it has provided the requested dimensioning parameters: - number of IRQs and number of vCPUs, - DIST and CPU in

Re: [PATCH 5/5] kvm: optimize GFN to memslot lookup with large slots amount

2014-12-02 Thread Radim Krčmář
2014-12-01 17:29+, Igor Mammedov: > Current linear search doesn't scale well when > large amount of memslots is used and looked up slot > is not in the beginning memslots array. > Taking in account that memslots don't overlap, it's > possible to switch sorting order of memslots array from > 'np

Re: [PATCH net] Revert "drivers/net: Disable UFO through virtio" in macvtap and tun

2014-12-02 Thread Vlad Yasevich
On 11/11/2014 12:12 PM, Ben Hutchings wrote: > This reverts commit 88e0e0e5aa722b193c8758c8b45d041de5316924 for > the tap drivers, but leaves UFO disabled in virtio_net. > > libvirt at least assumes that tap features will never be dropped > in new kernel versions, and doing so prevents migration o

Re: [PATCH] KVM: arm/arm64: vgic: add init entry to VGIC KVM device

2014-12-02 Thread Peter Maydell
On 2 December 2014 at 17:27, Eric Auger wrote: > Since the advent of dynamic initialization of VGIC, this latter is > initialized very late, on the first vcpu run. This initialization > could be initiated much earlier by the user, as soon as it has > provided the requested dimensioning parameters:

Re: [PATCH] KVM: arm/arm64: vgic: add init entry to VGIC KVM device

2014-12-02 Thread Eric Auger
On 12/02/2014 06:50 PM, Peter Maydell wrote: > On 2 December 2014 at 17:27, Eric Auger wrote: >> Since the advent of dynamic initialization of VGIC, this latter is >> initialized very late, on the first vcpu run. This initialization >> could be initiated much earlier by the user, as soon as it has

Re: [RFC PATCH v2 1/2] KVM: kvm-vfio: User API for VT-d Posted-Interrupts

2014-12-02 Thread Eric Auger
On 12/02/2014 05:02 PM, Alex Williamson wrote: > On Tue, 2014-12-02 at 08:52 +0100, Eric Auger wrote: >> On 12/02/2014 05:48 AM, Alex Williamson wrote: >>> On Tue, 2014-12-02 at 02:08 +, Wu, Feng wrote: > -Original Message- > From: Eric Auger [mailto:eric.au...@linaro.org]

Re: [PATCH 5/5] kvm: optimize GFN to memslot lookup with large slots amount

2014-12-02 Thread Paolo Bonzini
On 02/12/2014 18:33, Radim Krčmář wrote: >> > + while (start < end) { >> > + slot = start + (end - start) / 2; >> > + >> > + if (gfn >= memslots[slot].base_gfn) > (Even thought division is costly, I think that checking here if 'slot' > is the one we want wouldn't help very muc

Re: [PATCH 3/5] arm/arm64: KVM: Clarify KVM_ARM_VCPU_INIT ABI

2014-12-02 Thread Christoffer Dall
On Tue, Dec 02, 2014 at 03:39:05PM +, Peter Maydell wrote: > On 2 December 2014 at 14:47, Christoffer Dall > wrote: > > On Thu, Nov 27, 2014 at 10:53:50PM +, Peter Maydell wrote: > >> On 27 November 2014 at 18:40, Christoffer Dall > >> wrote: > >> > Possible features: > >> > - KV

Re: [PATCH RFC v5 07/19] virtio: allow virtio-1 queue layout

2014-12-02 Thread Michael S. Tsirkin
On Tue, Dec 02, 2014 at 04:41:36PM +0100, Cornelia Huck wrote: > void virtio_queue_set_num(VirtIODevice *vdev, int n, int num) > { > +/* > + * For virtio-1 devices, the number of buffers may only be > + * updated if the ring addresses have not yet been set up. Where does it say that?

Re: [PATCH v13 10/11] pvqspinlock, x86: Enable PV qspinlock for KVM

2014-12-02 Thread Konrad Rzeszutek Wilk
On Wed, Oct 29, 2014 at 04:19:10PM -0400, Waiman Long wrote: > This patch adds the necessary KVM specific code to allow KVM to > support the CPU halting and kicking operations needed by the queue > spinlock PV code. > > Two KVM guests of 20 CPU cores (2 nodes) were created for performance > testin

KVM call for agenda for 2014-12-08

2014-12-02 Thread Juan Quintela
Hi Please, send any topic that you are interested in covering. hanks, Juan. By popular demand, a google calendar public entry with it https://www.google.com/calendar/embed?src=dG9iMXRqcXAzN3Y4ZXZwNzRoMHE4a3BqcXNAZ3JvdXAuY2FsZW5kYXIuZ29vZ2xlLmNvbQ (Let me know if you have any problems with

Re: [PATCH 5/5] kvm: optimize GFN to memslot lookup with large slots amount

2014-12-02 Thread Radim Krčmář
2014-12-02 19:45+0100, Paolo Bonzini: > On 02/12/2014 18:33, Radim Krčmář wrote: > >> > +while (start < end) { > >> > +slot = start + (end - start) / 2; > >> > + > >> > +if (gfn >= memslots[slot].base_gfn) > > (Even thought division is costly, I think that ch

[kvm-unit-tests PATCH] x86: emulator: Fix h_mem usage in tests_smsw

2014-12-02 Thread Chris J Arges
In emulator.c/tests_smsw, smsw (3) fails because h_mem isn't being set correctly before smsw is called. By declaring the h_mem function parameter as volatile, the compiler no longer optimizes out the assignment before smsw. Signed-off-by: Chris J Arges --- x86/emulator.c | 2 +- 1 file changed,

Re: [PATCH] KVM: cpuid: mask more bits in leaf 0xd and subleaves

2014-12-02 Thread Radim Krčmář
2014-12-02 14:09+0100, Paolo Bonzini: > - EAX=0Dh, ECX=1: output registers EBX/ECX/EDX are reserved. (As good as reserved without XSAVES/IA32_XSS.) > - EAX=0Dh, ECX>1: output register ECX is zero for all the CPUID leaves > we support, because variable "supported" comes from XCR0 and not XSS. > Ho

Re: [PATCH v3 0/3] kvm: vmx: enable xsaves for kvm

2014-12-02 Thread Wanpeng Li
On Tue, Dec 02, 2014 at 02:00:24PM +0100, Paolo Bonzini wrote: > > >On 02/12/2014 12:14, Wanpeng Li wrote: >> This patchset is to enable xsaves for kvm part, the patch for >> qemu part will be sent out later. >> >> The patchset is tested on skylake-client. >> >> v2 -> v3: >> * add kvm_get/set

Re: [PATCH v13 10/11] pvqspinlock, x86: Enable PV qspinlock for KVM

2014-12-02 Thread Thomas Gleixner
On Wed, 29 Oct 2014, Waiman Long wrote: > AIM7 XFS Disk Test (no overcommit) > kernel JPMReal Time Sys TimeUsr Time > - ---- > PV ticketlock 25423737.08 98.95 5.44 > PV

[PATCH v4 3/3] kvm: x86: Enable Intel XSAVES for guest

2014-12-02 Thread Wanpeng Li
Expose intel xsaves feature to guest. Signed-off-by: Wanpeng Li --- arch/x86/kvm/cpuid.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index a4f5ac4..0d919bc 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -267,6

[PATCH v4 2/3] kvm: vmx: add kvm_get/set logic to xsaves

2014-12-02 Thread Wanpeng Li
Add kvm_get/set logic to xsaves. Signed-off-by: Wanpeng Li --- arch/x86/kvm/vmx.c | 26 ++ 1 file changed, 26 insertions(+) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 12915f1..ad1153a 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -99,6 +99,8

[PATCH v4 0/3] kvm: vmx: enable xsaves for kvm

2014-12-02 Thread Wanpeng Li
This patchset is to enable xsaves for kvm part and tested on skylake-client. v3 -> v4: * return false from an svm_xsaves_supported function * prevent setting MSR_IA32_XSS to any non-zero value v2 -> v3: * add kvm_get/set for ia32_xss * fix the type XSS_EXIT_BITMAP * load host_xss just once i

[PATCH v4 1/3] kvm: vmx: Intel XSAVES vmx and msr handle

2014-12-02 Thread Wanpeng Li
Intel xsaves vmx and msr handle. Signed-off-by: Wanpeng Li --- arch/x86/include/asm/kvm_host.h | 2 ++ arch/x86/include/asm/vmx.h | 3 +++ arch/x86/include/uapi/asm/vmx.h | 6 +- arch/x86/kvm/svm.c | 6 ++ arch/x86/kvm/vmx.c | 31 +++

Re: [PATCH v2 1/2] kvm: x86: revert mask out xsaves

2014-12-02 Thread Wanpeng Li
On Tue, Dec 02, 2014 at 09:55:09AM +0100, Paolo Bonzini wrote: > > >On 02/12/2014 07:14, Wanpeng Li wrote: >> xsaves will be exported to guest in the next patch, so revert the >> mask out xsaves patch. >> >> Signed-off-by: Wanpeng Li >> --- >> arch/x86/kvm/cpuid.c | 10 +- >> 1 file chan

[PATCH v2] target-i386: Intel xsaves

2014-12-02 Thread Wanpeng Li
Add xsaves related definition, it also adds corresponding part to kvm_get/put, and vmstate. Signed-off-by: Wanpeng Li --- v1 -> v2: * use a subsection instead of bumping the version number. target-i386/cpu.h | 2 ++ target-i386/kvm.c | 15 +++ target-i386/machine.c | 21 +

Re: [Xen-devel] [PATCH] xen: privcmd: schedule() after private hypercall when non CONFIG_PREEMPT

2014-12-02 Thread Luis R. Rodriguez
On Tue, Dec 02, 2014 at 11:11:18AM +, David Vrabel wrote: > On 01/12/14 22:36, Luis R. Rodriguez wrote: > > > > Then I do agree its a fair analogy (and find this obviously odd that how > > widespread cond_resched() is), we just don't have an equivalent for IRQ > > context, why not avoid the sp

[PATCH 0/5] Fixes and improvements for HV KVM on PPC

2014-12-02 Thread Paul Mackerras
This series of patches is based on Alex Graf's kvm-ppc-queue branch and is intended for the 3.19 merge window. It starts by removing the code to support HV KVM on PPC970 processors. This code is hardly used now since there are not many HV-capable PPC970 machines (Apple G5 machines are not HV-capa

[PATCH 3/5] KVM: PPC: Book3S HV: Improve H_CONFER implementation

2014-12-02 Thread Paul Mackerras
From: Sam Bobroff Currently the H_CONFER hcall is implemented in kernel virtual mode, meaning that whenever a guest thread does an H_CONFER, all the threads in that virtual core have to exit the guest. This is bad for performance because it interrupts the other threads even if they are doing use

[PATCH 1/5] KVM: PPC: Book3S HV: Remove code for PPC970 processors

2014-12-02 Thread Paul Mackerras
This removes the code that was added to enable HV KVM to work on PPC970 processors. The PPC970 is an old CPU that doesn't support virtualizing guest memory. Removing PPC970 support also lets us remove the code for allocating and managing contiguous real-mode areas, the code for the !kvm->arch.usi

[PATCH 5/5] KVM: PPC: Book3S: Enable in-kernel XICS emulation by default

2014-12-02 Thread Paul Mackerras
From: Anton Blanchard The in-kernel XICS emulation is faster than doing it all in QEMU and it has got a lot of testing, so enable it by default. Signed-off-by: Anton Blanchard Signed-off-by: Paul Mackerras --- arch/powerpc/kvm/Kconfig | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/p

[PATCH 4/5] KVM: PPC: Book3S HV: Add fast real-mode H_RANDOM implementation.

2014-12-02 Thread Paul Mackerras
From: Michael Ellerman Some PowerNV systems include a hardware random-number generator. This HWRNG is present on POWER7+ and POWER8 chips and is capable of generating one 64-bit random number every microsecond. The random numbers are produced by sampling a set of 64 unstable high-frequency oscil

[PATCH 2/5] KVM: PPC: Book3S HV: Fix endianness of instruction obtained from HEIR register

2014-12-02 Thread Paul Mackerras
There are two ways in which a guest instruction can be obtained from the guest in the guest exit code in book3s_hv_rmhandlers.S. If the exit was caused by a Hypervisor Emulation interrupt (i.e. an illegal instruction), the offending instruction is in the HEIR register (Hypervisor Emulation Instruc

[PATCH RESCEND v2] target-i386: Intel xsaves

2014-12-02 Thread Wanpeng Li
Add xsaves related definition, it also adds corresponding part to kvm_get/put, and vmstate. Signed-off-by: Wanpeng Li --- v1 -> v2: * use a subsection instead of bumping the version number. target-i386/cpu.h | 2 ++ target-i386/kvm.c | 15 +++ target-i386/machine.c | 21 +

[PATCH] powerpc: powernv: Return to cpu offline loop when finished in KVM guest

2014-12-02 Thread Paul Mackerras
When a secondary hardware thread has finished running a KVM guest, we currently put that thread into nap mode using a nap instruction in the KVM code. This changes the code so that instead of doing a nap instruction directly, we instead cause the call to power7_nap() that put the thread into nap m

Re: [Xen-devel] [PATCH] xen: privcmd: schedule() after private hypercall when non CONFIG_PREEMPT

2014-12-02 Thread Juergen Gross
On 12/03/2014 03:28 AM, Luis R. Rodriguez wrote: On Tue, Dec 02, 2014 at 11:11:18AM +, David Vrabel wrote: On 01/12/14 22:36, Luis R. Rodriguez wrote: Then I do agree its a fair analogy (and find this obviously odd that how widespread cond_resched() is), we just don't have an equivalent fo

[v2 16/25] KVM: make kvm_set_msi_irq() public

2014-12-02 Thread Feng Wu
Make kvm_set_msi_irq() public, we can use this function outside. Signed-off-by: Feng Wu --- include/linux/kvm_host.h |2 ++ virt/kvm/irq_comm.c |2 +- 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index cfa85ac..5c

[v2 25/25] iommu/vt-d: Add a command line parameter for VT-d posted-interrupts

2014-12-02 Thread Feng Wu
Enable VT-d Posted-Interrtups and add a command line parameter for it. Signed-off-by: Feng Wu --- Documentation/kernel-parameters.txt |1 + drivers/iommu/irq_remapping.c | 12 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Documentation/kernel-parameters.

[v2 23/25] KVM: Add the handler for Wake-up Vector

2014-12-02 Thread Feng Wu
When vCPU is blocked and an external interrupts from assigned devices is delivered to it, VT-d Posted-Interrupts mechanism will deliver an interrupt to the associated physical CPU with Wake-up Vector. In its handler, we find the destination vCPU and wake up it. Signed-off-by: Feng Wu --- arch/x8

[v2 24/25] KVM: Suppress posted-interrupt when 'SN' is set

2014-12-02 Thread Feng Wu
Currently, we don't support urgent interrupt, all interrupts are recognized as non-urgent interrupt, so we cannot send posted-interrupt when 'SN' is set. Signed-off-by: Feng Wu --- arch/x86/kvm/vmx.c | 11 +-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/

[v2 21/25] KVM: Update Posted-Interrupts descriptor during vCPU scheduling

2014-12-02 Thread Feng Wu
Update Posted-Interrupts descriptor according to the following rules: - Before vCPU block, set 'NV' to POSTED_INTR_WAKEUP_VECTOR - After vCPU block, set 'NV' back to POSTED_INTR_VECTOR Signed-off-by: Feng Wu --- arch/x86/include/asm/kvm_host.h |5 ++ arch/x86/kvm/vmx.c | 83 ++

[v2 22/25] KVM: Change NDST field after vCPU scheduling

2014-12-02 Thread Feng Wu
This patch changes the NDST filed of Posted-Interrupts Descriptor after vCPU is scheduled to another physical CPU. Signed-off-by: Feng Wu --- arch/x86/kvm/vmx.c | 25 + 1 files changed, 25 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx

[v2 19/25] KVM: x86: kvm-vfio: VT-d posted-interrupts setup

2014-12-02 Thread Feng Wu
This patch defines macro __KVM_HAVE_ARCH_KVM_VFIO_POSTING and implement kvm_arch_vfio_update_pi_irte for x86 architecture. Signed-off-by: Feng Wu --- arch/x86/include/asm/kvm_host.h |2 + arch/x86/kvm/Makefile |2 +- arch/x86/kvm/kvm_vfio_x86.c | 68 ++

[v2 17/25] KVM: kvm-vfio: User API for VT-d Posted-Interrupts

2014-12-02 Thread Feng Wu
This patch adds and documents a new attribute KVM_DEV_VFIO_DEVICE_POSTING_IRQ in KVM_DEV_VFIO_DEVICE group. This new attribute is used for VT-d Posted-Interrupts. When guest OS changes the interrupt configuration for an assigned device, such as, MSI/MSIx data/address fields, QEMU will use this IRQ

[v2 20/25] x86, irq: Define a global vector for VT-d Posted-Interrupts

2014-12-02 Thread Feng Wu
Currently, we use a global vector as the Posted-Interrupts Notification Event for all the vCPUs in the system. We need to introduce another global vector for VT-d Posted-Interrtups, which will be used to wakeup the sleep vCPU when an external interrupt from a direct-assigned device happens for that

[v2 18/25] KVM: kvm-vfio: implement the VFIO skeleton for VT-d Posted-Interrupts

2014-12-02 Thread Feng Wu
This patch adds the kvm-vfio interface for VT-d Posted-Interrrupts. When guests updates MSI/MSI-x information for an assigned-device, QEMU will use KVM_DEV_VFIO_DEVICE_POSTING_IRQ attribute to setup IRTE for VT-d PI. This patch implement this IRQ attribute. Signed-off-by: Feng Wu --- include/lin

[v2 11/25] KVM: Add some helper functions for Posted-Interrupts

2014-12-02 Thread Feng Wu
This patch adds some helper functions to manipulate the Posted-Interrupts Descriptor. Signed-off-by: Feng Wu --- arch/x86/kvm/vmx.c | 26 ++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index abdb84f..0b1383e 10

  1   2   >