Re: [PATCH v4] virt: IRQ bypass manager

2015-08-18 Thread Eric Auger
Reviewed-by: Eric Auger eric.au...@linaro.org Tested-by: Eric Auger eric.au...@linaro.org Best Regards Eric On 08/06/2015 07:42 PM, Alex Williamson wrote: When a physical I/O device is assigned to a virtual machine through facilities like VFIO and KVM, the interrupt for the device generally

Re: [PATCH v2 4/4] irqchip: GIC: Don't deactivate interrupts forwarded to a guest

2015-08-18 Thread Eric Auger
Hi Marc, On 08/13/2015 10:28 AM, Marc Zyngier wrote: Commit 0a4377de3056 (genirq: Introduce irq_set_vcpu_affinity() to target an interrupt to a VCPU) added just what we needed at the lowest level to allow an interrupt to be deactivated by a guest. When such a request reaches the GIC, it

[RFC PATCH 2/5] KVM: add KVM_EXIT_MSR exit reason and capability.

2015-08-18 Thread Peter Hornyack
Define KVM_EXIT_MSR, a new exit reason for accesses to MSRs that kvm does not handle. Define KVM_CAP_UNHANDLED_MSR_EXITS, a vm-wide capability that guards the new exit reason and which can be enabled via the KVM_ENABLE_CAP ioctl. Signed-off-by: Peter Hornyack peterhorny...@google.com ---

[RFC PATCH 3/5] KVM: x86: add msr_exits_supported to kvm_x86_ops

2015-08-18 Thread Peter Hornyack
msr_exits_supported will be checked when user space attempts to enable the KVM_CAP_UNHANDLED_MSR_EXITS capability for the vm. This is needed because MSR exit support will be implemented for vmx but not svm later in this patchset. Signed-off-by: Peter Hornyack peterhorny...@google.com ---

[RFC PATCH 5/5] KVM: x86: add trace events for unhandled MSR exits

2015-08-18 Thread Peter Hornyack
Add trace_kvm_userspace_msr and call it when user space reenters kvm after KVM_EXIT_MSR. Add KVM_EXIT_MSR to kvm_trace_exit_reason list. Signed-off-by: Peter Hornyack peterhorny...@google.com --- arch/x86/kvm/trace.h | 28 arch/x86/kvm/vmx.c | 4

[RFC PATCH 1/5] KVM: x86: refactor vmx rdmsr/wrmsr completion into new functions

2015-08-18 Thread Peter Hornyack
After handling a rdmsr or wrmsr, refactor the success and failure code paths into separate functions. This will allow us to also complete or fail MSR accesses on the entry path from userspace into kvm. Signed-off-by: Peter Hornyack peterhorny...@google.com --- arch/x86/kvm/vmx.c | 44

[RFC PATCH 0/5] KVM: x86: exit to user space on unhandled MSR accesses

2015-08-18 Thread Peter Hornyack
There are numerous MSRs that kvm does not currently handle. On Intel platforms we have observed guest VMs accessing some of these MSRs (for example, MSR_PLATFORM_INFO) and behaving poorly (to the point of guest OS crashes) when they receive a GP fault because the MSR is not emulated. This patchset

[RFC PATCH 4/5] KVM: x86: enable unhandled MSR exits for vmx

2015-08-18 Thread Peter Hornyack
Set the vm's unhandled_msr_exits flag when user space calls the KVM_ENABLE_CAP ioctl with KVM_CAP_UNHANDLED_MSR_EXITS. After kvm fails to handle a guest rdmsr or wrmsr, check this flag and exit to user space with KVM_EXIT_MSR rather than immediately injecting a GP fault. On reentry into kvm, use

Re: [PATCH v3 04/10] VFIO: platform: add vfio_platform_set_automasked

2015-08-18 Thread Alex Williamson
On Mon, 2015-08-17 at 17:38 +0200, Eric Auger wrote: On 08/12/2015 08:56 PM, Alex Williamson wrote: On Mon, 2015-08-10 at 15:20 +0200, Eric Auger wrote: This function makes possible to change the automasked mode. Signed-off-by: Eric Auger eric.au...@linaro.org --- v1 - v2: - set

Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace exit

2015-08-18 Thread Avi Kivity
On 08/17/2015 04:15 PM, Paolo Bonzini wrote: On 16/08/2015 13:27, Avi Kivity wrote: On 08/05/2015 07:33 PM, Radim Krčmář wrote: The guest can use KVM_USER_EXIT instead of a signal-based exiting to userspace. Availability depends on KVM_CAP_USER_EXIT. Only x86 is implemented so far.

Re: [PATCH v2 4/5] KVM: add KVM_USER_EXIT vcpu ioctl for userspace exit

2015-08-18 Thread Paolo Bonzini
On 18/08/2015 11:30, Avi Kivity wrote: KVM_USER_EXIT in practice should be so rare (at least with in-kernel LAPIC) that I don't think this matters. KVM_USER_EXIT is relatively uninteresting, it only exists to provide an alternative to signals that doesn't require expensive atomics on each

Re: [PATCH 7/12] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers

2015-08-18 Thread Wanpeng Li
On 7/3/15 8:01 PM, Denis V. Lunev wrote: From: Andrey Smetanin asmeta...@virtuozzo.com Added hyper-v crash msr's(HV_X64_MSR_CRASH*) data and control geters and setters. Userspace should check that such msr's available by check of KVM_CAP_HYPERV_MSR_CRASH capability. I didn't see the

Re: [PATCH 7/12] kvm/x86: added hyper-v crash data and ctl msr's get/set'ers

2015-08-18 Thread Denis V. Lunev
On 08/18/2015 05:41 PM, Wanpeng Li wrote: On 7/3/15 8:01 PM, Denis V. Lunev wrote: From: Andrey Smetanin asmeta...@virtuozzo.com Added hyper-v crash msr's(HV_X64_MSR_CRASH*) data and control geters and setters. Userspace should check that such msr's available by check of

Re: [Qemu-devel] Help debugging a regression in KVM Module

2015-08-18 Thread Peter Lieven
Am 14.08.2015 um 22:01 schrieb Alex Bennée: Peter Lieven p...@kamp.de writes: Hi, some time a go I stumbled across a regression in the KVM Module that has been introduced somewhere between 3.17 and 3.19. I have a rather old openSUSE guest with an XFS filesystem which realiably crashes

Re: Runtime-modified DIMMs and live migration issue

2015-08-18 Thread Andrey Korolyov
Fixed with cherry-pick of the 7a72f7a140bfd3a5dae73088947010bfdbcf6a40 and its predecessor 7103f60de8bed21a0ad5d15d2ad5b7a333dda201. Of course this is not a real fix as the only race precondition is shifted/disappeared by a clear assumption. Though there are not too many hotplug users around, I

Re: [Qemu-devel] Help debugging a regression in KVM Module

2015-08-18 Thread Radim Krčmář
2015-08-18 16:54+0200, Peter Lieven: After some experiments I was able to find out the bad commit that introduced the regression: commit f30ebc312ca9def25650b4e1d01cdb425c310dca Author: Radim Krčmář rkrc...@redhat.com Date: Thu Oct 30 15:06:47 2014 +0100 It seems that this

Re: [Qemu-devel] Help debugging a regression in KVM Module

2015-08-18 Thread Peter Lieven
Am 18.08.2015 um 17:25 schrieb Radim Krčmář rkrc...@redhat.com: 2015-08-18 16:54+0200, Peter Lieven: After some experiments I was able to find out the bad commit that introduced the regression: commit f30ebc312ca9def25650b4e1d01cdb425c310dca Author: Radim Krčmář rkrc...@redhat.com