Re: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting

2013-02-23 Thread Marcelo Tosatti
On Fri, Feb 22, 2013 at 09:42:32PM +0800, Yang Zhang wrote: From: Yang Zhang yang.z.zh...@intel.com Posted Interrupt allows APIC interrupts to inject into guest directly without any vmexit. - When delivering a interrupt to guest, if target vcpu is running, update Posted-interrupt

RE: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting

2013-02-23 Thread Zhang, Yang Z
Marcelo Tosatti wrote on 2013-02-23: On Fri, Feb 22, 2013 at 09:42:32PM +0800, Yang Zhang wrote: From: Yang Zhang yang.z.zh...@intel.com Posted Interrupt allows APIC interrupts to inject into guest directly without any vmexit. - When delivering a interrupt to guest, if target vcpu is

[PATCH] KVM: VMX: Make prepare_vmcs12 and load_vmcs12_host_state static

2013-02-23 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Both are only used locally. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- arch/x86/kvm/vmx.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index d6ea4a7..7bd9f88 100644 ---

Re: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting

2013-02-23 Thread Gleb Natapov
On Sat, Feb 23, 2013 at 02:05:28PM +, Zhang, Yang Z wrote: + return test_bit(vector, (unsigned long *)pi_desc-pir); +} + +static void pi_set_pir(int vector, struct pi_desc *pi_desc) +{ + __set_bit(vector, (unsigned long *)pi_desc-pir); +} This must be locked atomic

Re: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting

2013-02-23 Thread Marcelo Tosatti
On Sat, Feb 23, 2013 at 02:05:28PM +, Zhang, Yang Z wrote: Marcelo Tosatti wrote on 2013-02-23: On Fri, Feb 22, 2013 at 09:42:32PM +0800, Yang Zhang wrote: From: Yang Zhang yang.z.zh...@intel.com Posted Interrupt allows APIC interrupts to inject into guest directly without any

Re: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting

2013-02-23 Thread Marcelo Tosatti
On Sat, Feb 23, 2013 at 04:35:30PM +0200, Gleb Natapov wrote: On Sat, Feb 23, 2013 at 02:05:28PM +, Zhang, Yang Z wrote: +return test_bit(vector, (unsigned long *)pi_desc-pir); +} + +static void pi_set_pir(int vector, struct pi_desc *pi_desc) +{ +

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-23 Thread Marcelo Tosatti
On Thu, Feb 21, 2013 at 08:00:25PM -0600, Scott Wood wrote: On 02/21/2013 05:03:32 PM, Marcelo Tosatti wrote: On Wed, Feb 20, 2013 at 07:28:52PM -0600, Scott Wood wrote: On 02/20/2013 06:14:37 PM, Marcelo Tosatti wrote: On Wed, Feb 20, 2013 at 05:53:20PM -0600, Scott Wood wrote: It is

Re: [Qemu-devel] [PATCH v6 3/9] ARM: KVM: Add support for KVM on ARM architecture

2013-02-23 Thread Andreas Färber
Am 22.02.2013 20:04, schrieb Peter Maydell: From: Christoffer Dall cd...@cs.columbia.edu Add basic support for KVM on ARM architecture. Signed-off-by: Christoffer Dall cd...@cs.columbia.edu [PMM: Minor tweaks and code cleanup, switch to ONE_REG] Signed-off-by: Peter Maydell

RE: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting

2013-02-23 Thread Zhang, Yang Z
Marcelo Tosatti wrote on 2013-02-23: On Sat, Feb 23, 2013 at 02:05:28PM +, Zhang, Yang Z wrote: Marcelo Tosatti wrote on 2013-02-23: On Fri, Feb 22, 2013 at 09:42:32PM +0800, Yang Zhang wrote: From: Yang Zhang yang.z.zh...@intel.com Posted Interrupt allows APIC interrupts to inject

Re: [Qemu-devel] [PATCH v6 7/9] hw/kvm/arm_gic: Implement support for KVM in-kernel ARM GIC

2013-02-23 Thread Andreas Färber
Am 22.02.2013 20:04, schrieb Peter Maydell: Implement support for using the KVM in-kernel GIC for ARM. Signed-off-by: Peter Maydell peter.mayd...@linaro.org Reviewed-by: Paolo Bonzini pbonz...@redhat.com --- hw/a15mpcore.c |8 ++- hw/arm/Makefile.objs |1 + hw/kvm/arm_gic.c

Re: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting

2013-02-23 Thread Gleb Natapov
On Sat, Feb 23, 2013 at 11:48:54AM -0300, Marcelo Tosatti wrote: 1. orig_irr = read irr from vapic page 2. if (orig_irr != 0) 3. return false; 4. kvm_make_request(KVM_REQ_EVENT) 5. bool injected = !test_and_set_bit(PIR) 6. if (vcpu-guest_mode injected) 7. if

[PATCH] target-i386: Improve x86_cpu_list output

2013-02-23 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Several issues fixed: - We were missing a bunch of feature lists. Fix this by simply dumping the meta list feature_word_info. - kvm_enabled() cannot be true at this point because accelerators are initialized much later during init. Simply dump

[PATCH RFT ppc-next] target-ppc: Make host CPU a subclass of the host's CPU model

2013-02-23 Thread Andreas Färber
This avoids assigning individual class fields and contributors forgetting to add field assignments in KVM-only code. ppc_cpu_class_find_by_pvr() requires the CPU model classes to be registered, so defer host CPU type registration to kvm_arch_init(). Only register the host CPU type if there is a

[PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock

2013-02-23 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com This fixes boot lockups with no-kvmclock, when the host is not exposing this particular feature (QEMU: -cpu ...,-kvmclock) or when the kvmclock initialization failed for whatever reason. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Should go to

Re: [PATCH] x86: kvmclock: Do not setup kvmclock vsyscall in the absence of that clock

2013-02-23 Thread Jan Kiszka
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Sorry, $subject reflects only half of the fix (v0.1, when I thought hunk #2 would suffice). A better headline: x86: kvmclock: Fix boot with kvmclock disabled or not existing If you want me to resend, let me know. Jan On 2013-02-23 17:05, Jan

Re: [Qemu-devel] [PATCH ppc-next v2 42/52] target-ppc: Convert CPU definitions

2013-02-23 Thread Andreas Färber
Am 22.02.2013 17:32, schrieb Alexander Graf: On 22.02.2013, at 17:31, Andreas Färber wrote: Am 22.02.2013 15:23, schrieb Alexander Graf: On 18.02.2013, at 10:16, Andreas Färber wrote: diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c index 2c64c63..e601059 100644 --- a/target-ppc/kvm.c

Re: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting

2013-02-23 Thread Marcelo Tosatti
On Sat, Feb 23, 2013 at 05:31:44PM +0200, Gleb Natapov wrote: On Sat, Feb 23, 2013 at 11:48:54AM -0300, Marcelo Tosatti wrote: 1. orig_irr = read irr from vapic page 2. if (orig_irr != 0) 3.return false; 4. kvm_make_request(KVM_REQ_EVENT) 5. bool injected =

Re: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting

2013-02-23 Thread Marcelo Tosatti
On Sat, Feb 23, 2013 at 03:16:11PM +, Zhang, Yang Z wrote: Marcelo Tosatti wrote on 2013-02-23: On Sat, Feb 23, 2013 at 02:05:28PM +, Zhang, Yang Z wrote: Marcelo Tosatti wrote on 2013-02-23: On Fri, Feb 22, 2013 at 09:42:32PM +0800, Yang Zhang wrote: From: Yang Zhang

Re: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting

2013-02-23 Thread Gleb Natapov
On Sat, Feb 23, 2013 at 02:05:13PM -0300, Marcelo Tosatti wrote: On Sat, Feb 23, 2013 at 05:31:44PM +0200, Gleb Natapov wrote: On Sat, Feb 23, 2013 at 11:48:54AM -0300, Marcelo Tosatti wrote: 1. orig_irr = read irr from vapic page 2. if (orig_irr != 0) 3. return false;

Re: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting

2013-02-23 Thread Marcelo Tosatti
On Sat, Feb 23, 2013 at 09:42:14PM +0200, Gleb Natapov wrote: explanation why its believed to be benign (given how the injection return value is interpreted) could also work. Its ugly, though... murphy is around. The race above is not benign. It will report interrupt as coalesced while in

Re: [PATCH v4 2/2] KVM: VMX: Add Posted Interrupt supporting

2013-02-23 Thread Gleb Natapov
On Sat, Feb 23, 2013 at 04:52:59PM -0300, Marcelo Tosatti wrote: OTOH spinlock is not the end of the world, can figure out something later (we've tried without success so far). It serializes all injections into vcpu. I do not believe now that even with lock we are safe for the reason I

Re: [Qemu-devel] [PATCH RFT ppc-next] target-ppc: Make host CPU a subclass of the host's CPU model

2013-02-23 Thread Andreas Färber
Am 23.02.2013 17:00, schrieb Andreas Färber: This avoids assigning individual class fields and contributors forgetting to add field assignments in KVM-only code. ppc_cpu_class_find_by_pvr() requires the CPU model classes to be registered, so defer host CPU type registration to

[PATCH ppc-next v2] target-ppc: Make host CPU a subclass of the host's CPU model

2013-02-23 Thread Andreas Färber
This avoids assigning individual class fields and contributors forgetting to add field assignments in KVM-only code. ppc_cpu_class_find_by_pvr() requires the CPU model classes to be registered, so defer host CPU type registration to kvm_arch_init(). Only register the host CPU type if there is a

[PATCH] KVM: nVMX: Advertise PAUSE and WBINVD exiting support

2013-02-23 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com These exits have no preconditions, and we already process the corresponding reasons in nested_vmx_exit_handled correctly. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- arch/x86/kvm/vmx.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-)

[PATCH] KVM: nVMX: Replace kvm_set_cr0 with vmx_set_cr0 in load_vmcs12_host_state

2013-02-23 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Likely a typo, but a fatal one as kvm_set_cr0 performs checks on the state transition that may prevent loading L1's cr0. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- arch/x86/kvm/vmx.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-)

[PATCH] KVM: nVMX: Clear segment cache after switching between L1 and L2

2013-02-23 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com Switching the VMCS obviously invalidates what may have been cached about the guest segments. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Probably, the missing invalidations are harmless ATM, but you never know. arch/x86/kvm/vmx.c |4 1

Re: [PATCH] KVM: nVMX: Replace kvm_set_cr0 with vmx_set_cr0 in load_vmcs12_host_state

2013-02-23 Thread Nadav Har'El
On Sat, Feb 23, 2013, Jan Kiszka wrote about [PATCH] KVM: nVMX: Replace kvm_set_cr0 with vmx_set_cr0 in load_vmcs12_host_state: - kvm_set_cr0(vcpu, vmcs12-host_cr0); + vmx_set_cr0(vcpu, vmcs12-host_cr0); I don't remember now why I did this (and I'm not looking at the code), but this

Re: [PATCH] KVM: nVMX: Replace kvm_set_cr0 with vmx_set_cr0 in load_vmcs12_host_state

2013-02-23 Thread Jan Kiszka
On 2013-02-23 22:45, Nadav Har'El wrote: On Sat, Feb 23, 2013, Jan Kiszka wrote about [PATCH] KVM: nVMX: Replace kvm_set_cr0 with vmx_set_cr0 in load_vmcs12_host_state: -kvm_set_cr0(vcpu, vmcs12-host_cr0); +vmx_set_cr0(vcpu, vmcs12-host_cr0); I don't remember now why I did this

Re: [PATCH] KVM: nVMX: Replace kvm_set_cr0 with vmx_set_cr0 in load_vmcs12_host_state

2013-02-23 Thread Jan Kiszka
On 2013-02-23 22:57, Jan Kiszka wrote: On 2013-02-23 22:45, Nadav Har'El wrote: On Sat, Feb 23, 2013, Jan Kiszka wrote about [PATCH] KVM: nVMX: Replace kvm_set_cr0 with vmx_set_cr0 in load_vmcs12_host_state: - kvm_set_cr0(vcpu, vmcs12-host_cr0); + vmx_set_cr0(vcpu, vmcs12-host_cr0); I

[PATCH v5 0/3] AER-KVM: Error containment of VFIO devices assigned to KVM guests

2013-02-23 Thread Vijay Mohan Pandarathil
Add support for error containment when a VFIO device assigned to a KVM guest encounters an error. This is for PCIe devices/drivers that support AER functionality. When the host OS is notified of an error in a device either through the firmware first approach or through an interrupt handled by the

[PATCH v5 1/3] VFIO: Wrapper for getting reference to vfio_device from device

2013-02-23 Thread Vijay Mohan Pandarathil
- Added vfio_device_get_from_dev() as wrapper to get reference to vfio_device from struct device. - Added vfio_device_data() as a wrapper to get device_data from vfio_device. Signed-off-by: Vijay Mohan Pandarathil vijaymohan.pandarat...@hp.com ---

[PATCH v5 2/3] VFIO-AER: Vfio-pci driver changes for supporting AER

2013-02-23 Thread Vijay Mohan Pandarathil
- New VFIO_SET_IRQ ioctl option to pass the eventfd that is signaled when an error occurs in the vfio_pci_device - Register pci_error_handler for the vfio_pci driver - When the device encounters an error, the error handler registered by the vfio_pci

[PATCH v5 3/3] QEMU-AER: Qemu changes to support AER for VFIO-PCI devices

2013-02-23 Thread Vijay Mohan Pandarathil
- Create eventfd per vfio device assigned to a guest and register an event handler - This fd is passed to the vfio_pci driver through the SET_IRQ ioctl - When the device encounters an error, the eventfd is signalled and the qemu eventfd handler gets

Re: [RFC PATCH 1/6] kvm: add device control API

2013-02-23 Thread Marcelo Tosatti
On Thu, Feb 21, 2013 at 08:00:25PM -0600, Scott Wood wrote: On 02/21/2013 05:03:32 PM, Marcelo Tosatti wrote: On Wed, Feb 20, 2013 at 07:28:52PM -0600, Scott Wood wrote: On 02/20/2013 06:14:37 PM, Marcelo Tosatti wrote: On Wed, Feb 20, 2013 at 05:53:20PM -0600, Scott Wood wrote: It is