[PATCH v2 0/4] tcm_vhost fix cmd leak and send bad target

2013-04-10 Thread Asias He
v2: - Fix the order of out and head parameter. Asias He (4): tcm_vhost: Remove double check of response tcm_vhost: Fix tv_cmd leak in vhost_scsi_handle_vq tcm_vhost: Add vhost_scsi_send_bad_target() helper tcm_vhost: Send bad target to guest when cmd fails drivers/vhost/tcm_vhost.c | 53

[PATCH v2 1/4] tcm_vhost: Remove double check of response

2013-04-10 Thread Asias He
We did the length of response check twice. Signed-off-by: Asias He --- drivers/vhost/tcm_vhost.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index c127731..28c112f 100644 --- a/drivers/vhost/tcm_vhost.c +++ b/drivers/vhost/tcm

[PATCH v2 2/4] tcm_vhost: Fix tv_cmd leak in vhost_scsi_handle_vq

2013-04-10 Thread Asias He
If we fail to submit the allocated tv_vmd to tcm_vhost_submission_work, we will leak the tv_vmd. Free tv_vmd on fail path. Signed-off-by: Asias He --- drivers/vhost/tcm_vhost.c | 9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/

[PATCH v2 3/4] tcm_vhost: Add vhost_scsi_send_bad_target() helper

2013-04-10 Thread Asias He
Share the send bad target code with other use cases. Signed-off-by: Asias He --- drivers/vhost/tcm_vhost.c | 31 ++- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 210d59e..1bb0fb4 100644 ---

[PATCH v2 4/4] tcm_vhost: Send bad target to guest when cmd fails

2013-04-10 Thread Asias He
Send bad target to guest in case: 1) we can not allocate the cmd 2) fail to submit the cmd Signed-off-by: Asias He --- drivers/vhost/tcm_vhost.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/vhost/tcm_vhost.c b/drivers/vhost/tcm_vhost.c index 1bb0fb4..957

Re: [PATCH v8 2/7] KVM: VMX: Register a new IPI for posted interrupt

2013-04-10 Thread Ingo Molnar
* Gleb Natapov wrote: > On Mon, Apr 08, 2013 at 10:23:17PM +0800, Yang Zhang wrote: > > From: Yang Zhang > > > > Posted Interrupt feature requires a special IPI to deliver posted interrupt > > to guest. And it should has a high priority so the interrupt will not be > > blocked by others. > > N

Re: [RFC PATCH] Emulate MOVBE

2013-04-10 Thread Andre Przywara
On Wed, 10 Apr 2013 01:46:02 +0200 Borislav Petkov wrote: > Hi guys, > > so I was trying to repro tglx's bug in smpboot.c and for some reason, > the most reliable way to trigger it was to boot an 32-bit atom smp > guest in kvm (don't ask :)). > > The problem, however, was that atom wants MOVBE

Re: [RFC PATCH] Emulate MOVBE

2013-04-10 Thread Borislav Petkov
On Tue, Apr 09, 2013 at 05:04:06PM -0700, H. Peter Anvin wrote: > On 04/09/2013 05:03 PM, Borislav Petkov wrote: > > > > Note to self: this destroys the src operand but it shouldn't. Fix it > > tomorrow. > > > > I thought movbe was already in qemu just not on by default...? Yep, this went upstr

Re: [RFC PATCH] Emulate MOVBE

2013-04-10 Thread Gleb Natapov
On Wed, Apr 10, 2013 at 11:29:42AM +0200, Andre Przywara wrote: > In a real world VendorSpecific should be replaced with something more > meaningful. Depends on KVMs intention to emulate instructions, actually > out of scope for a pure virtualizer. > Something like EmulateOnUD. > What is the opin

Re: [RFC PATCH] Emulate MOVBE

2013-04-10 Thread Borislav Petkov
On Wed, Apr 10, 2013 at 01:08:46PM +0300, Gleb Natapov wrote: > We can add the emulation, but we should not start announcing the > instruction availability to a guest if host cpu does not have it > by default. This may trick a guest into thinking that movbe is the > fastest way to do something when

Re: [RFC PATCH] Emulate MOVBE

2013-04-10 Thread Gleb Natapov
On Wed, Apr 10, 2013 at 12:17:21PM +0200, Borislav Petkov wrote: > On Wed, Apr 10, 2013 at 01:08:46PM +0300, Gleb Natapov wrote: > > We can add the emulation, but we should not start announcing the > > instruction availability to a guest if host cpu does not have it > > by default. This may trick a

Re: [RFC PATCH] Emulate MOVBE

2013-04-10 Thread Andre Przywara
On Wed, 10 Apr 2013 13:08:46 +0300 Gleb Natapov wrote: > On Wed, Apr 10, 2013 at 11:29:42AM +0200, Andre Przywara wrote: > > In a real world VendorSpecific should be replaced with something > > more meaningful. Depends on KVMs intention to emulate instructions, > > actually out of scope for a pur

vhost_net module TX path is expensive?

2013-04-10 Thread Tushar Swain
Hi, I am running a VM in Linux-kvm (kernel 3.6.11-4 ) that uses vhost_net driver for sending/receiving traffic in backend. VM has two ports and the stack running in the VM functions like a simple router that receives packet from one virtual port and simply routes it to other virtual port. In the b

Re: [RFC PATCH] Emulate MOVBE

2013-04-10 Thread Gleb Natapov
On Wed, Apr 10, 2013 at 12:39:01PM +0200, Andre Przywara wrote: > On Wed, 10 Apr 2013 13:08:46 +0300 > Gleb Natapov wrote: > > > On Wed, Apr 10, 2013 at 11:29:42AM +0200, Andre Przywara wrote: > > > In a real world VendorSpecific should be replaced with something > > > more meaningful. Depends on

[PATCH v9 0/7] Use eoi to track RTC interrupt delivery status

2013-04-10 Thread Yang Zhang
From: Yang Zhang Current interrupt coalescing logci which only used by RTC has conflict with Posted Interrupt. This patch introduces a new mechinism to use eoi to track interrupt: When delivering an interrupt to vcpu, the pending_eoi set to number of vcpu that received the interrupt. And decreas

[PATCH v9 1/7] KVM: Add vcpu info to ioapic_update_eoi()

2013-04-10 Thread Yang Zhang
From: Yang Zhang Add vcpu info to ioapic_update_eoi, so we can know which vcpu issued this EOI. Signed-off-by: Yang Zhang --- arch/x86/kvm/lapic.c |2 +- virt/kvm/ioapic.c| 12 ++-- virt/kvm/ioapic.h|3 ++- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git

[PATCH v9 2/7] KVM: Introduce struct rtc_status

2013-04-10 Thread Yang Zhang
From: Yang Zhang rtc_status is used to track RTC interrupt delivery status. The pending_eoi will be increased by vcpu who received RTC interrupt and will be decreased when EOI to this interrupt. Also, we use dest_map to record the destination vcpu to avoid the case that vcpu who didn't get the RT

[PATCH v9 3/7] KVM: Return destination vcpu on interrupt injection

2013-04-10 Thread Yang Zhang
From: Yang Zhang Add a new parameter to know vcpus who received the interrupt. Signed-off-by: Yang Zhang --- arch/x86/kvm/lapic.c | 25 - arch/x86/kvm/lapic.h |5 +++-- virt/kvm/ioapic.c|2 +- virt/kvm/ioapic.h|2 +- virt/kvm/irq_comm.c | 12 +++

[PATCH v9 4/7] KVM: Add reset/restore rtc_status support

2013-04-10 Thread Yang Zhang
From: Yang Zhang restore rtc_status from migration or save/restore Signed-off-by: Yang Zhang --- arch/x86/kvm/lapic.c |9 +++ arch/x86/kvm/lapic.h |2 + virt/kvm/ioapic.c| 58 ++ virt/kvm/ioapic.h|1 + 4 files changed, 7

[PATCH v9 5/7] KVM: Force vmexit with virtual interrupt delivery

2013-04-10 Thread Yang Zhang
From: Yang Zhang Need the EOI to track interrupt deliver status, so force vmexit on EOI for rtc interrupt when enabling virtual interrupt delivery. Signed-off-by: Yang Zhang --- virt/kvm/ioapic.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/virt/kvm/ioapic.c b/virt

[PATCH v9 7/7] KVM: Use eoi to track RTC interrupt delivery status

2013-04-10 Thread Yang Zhang
From: Yang Zhang Current interrupt coalescing logci which only used by RTC has conflict with Posted Interrupt. This patch introduces a new mechinism to use eoi to track interrupt: When delivering an interrupt to vcpu, the pending_eoi set to number of vcpu that received the interrupt. And decrease

[PATCH v9 6/7] KVM: Let ioapic know the irq line status

2013-04-10 Thread Yang Zhang
From: Yang Zhang Userspace may deliver RTC interrupt without query the status. So we want to track RTC EOI for this case. Signed-off-by: Yang Zhang --- arch/x86/kvm/i8254.c |4 ++-- arch/x86/kvm/x86.c |6 -- include/linux/kvm_host.h | 11 +++ virt/kvm/assigned-d

[PATCH v9 0/7] KVM: VMX: Add Posted Interrupt supporting

2013-04-10 Thread Yang Zhang
From: Yang Zhang The follwoing patches are adding the Posted Interrupt supporting to KVM: The first patch enables the feature 'acknowledge interrupt on vmexit'.Since it is required by Posted interrupt, we need to enable it firstly. And the subsequent patches are adding the posted interrupt suppo

[PATCH v9 1/7] KVM: VMX: Enable acknowledge interupt on vmexit

2013-04-10 Thread Yang Zhang
From: Yang Zhang The "acknowledge interrupt on exit" feature controls processor behavior for external interrupt acknowledgement. When this control is set, the processor acknowledges the interrupt controller to acquire the interrupt vector on VM exit. After enabling this feature, an interrupt whi

[PATCH v9 2/7] KVM: VMX: Register a new IPI for posted interrupt

2013-04-10 Thread Yang Zhang
From: Yang Zhang Posted Interrupt feature requires a special IPI to deliver posted interrupt to guest. And it should has a high priority so the interrupt will not be blocked by others. Normally, the posted interrupt will be consumed by vcpu if target vcpu is running and transparent to OS. But in

[PATCH v9 4/7] KVM: Call common update function when ioapic entry changed.

2013-04-10 Thread Yang Zhang
From: Yang Zhang Both TMR and EOI exit bitmap need to be updated when ioapic changed or vcpu's id/ldr/dfr changed. So use common function instead eoi exit bitmap specific function. Signed-off-by: Yang Zhang --- arch/ia64/kvm/lapic.h|6 -- arch/x86/kvm/lapic.c |8 ++-- a

[PATCH v9 3/7] KVM: VMX: Check the posted interrupt capability

2013-04-10 Thread Yang Zhang
From: Yang Zhang Detect the posted interrupt feature. If it exists, then set it in vmcs_config. Signed-off-by: Yang Zhang --- arch/x86/include/asm/vmx.h |4 ++ arch/x86/kvm/vmx.c | 82 +--- 2 files changed, 66 insertions(+), 20 deletions(-)

[PATCH v9 7/7] KVM: VMX: Use posted interrupt to deliver virtual interrupt

2013-04-10 Thread Yang Zhang
From: Yang Zhang If posted interrupt is avaliable, then uses it to inject virtual interrupt to guest. Signed-off-by: Yang Zhang --- arch/x86/kvm/lapic.c | 32 +--- arch/x86/kvm/vmx.c |2 +- arch/x86/kvm/x86.c |1 + 3 files changed, 23 insertions(+), 12

[PATCH v9 5/7] KVM: Set TMR when programming ioapic entry

2013-04-10 Thread Yang Zhang
From: Yang Zhang We already know the trigger mode of a given interrupt when programming the ioapice entry. So it's not necessary to set it in each interrupt delivery. Signed-off-by: Yang Zhang --- arch/x86/kvm/lapic.c | 15 +-- arch/x86/kvm/lapic.h |1 + arch/x86/kvm/x86.c

[PATCH v9 6/7] KVM: VMX: Add the algorithm of deliver posted interrupt

2013-04-10 Thread Yang Zhang
From: Yang Zhang Only deliver the posted interrupt when target vcpu is running and there is no previous interrupt pending in pir. Signed-off-by: Yang Zhang --- arch/x86/include/asm/kvm_host.h |2 + arch/x86/kvm/lapic.c| 13 arch/x86/kvm/lapic.h|1 + a

Re: [PATCH v3 2/5] KVM: nVMX: Rework event injection and recovery

2013-04-10 Thread Gleb Natapov
On Sun, Mar 24, 2013 at 07:44:45PM +0100, Jan Kiszka wrote: > From: Jan Kiszka > > The basic idea is to always transfer the pending event injection on > vmexit into the architectural state of the VCPU and then drop it from > there if it turns out that we left L2 to enter L1, i.e. if we enter > pr

vhost_net module TX path is expensive?

2013-04-10 Thread Tushar Swain
Hi, I am running a VM in Linux-kvm (kernel 3.6.11-4 ) that uses vhost_net driver for sending/receiving traffic in backend. VM has two ports and the stack running in the VM functions like a simple router that receives packet from one virtual port and simply routes it to other virtual port. In the b

Re: [PATCH v3 2/5] KVM: nVMX: Rework event injection and recovery

2013-04-10 Thread Jan Kiszka
On 2013-04-10 15:42, Gleb Natapov wrote: > On Sun, Mar 24, 2013 at 07:44:45PM +0100, Jan Kiszka wrote: >> From: Jan Kiszka >> >> The basic idea is to always transfer the pending event injection on >> vmexit into the architectural state of the VCPU and then drop it from >> there if it turns out tha

Re: [PATCH v3 02/32] arm64: KVM: define HYP and Stage-2 translation page flags

2013-04-10 Thread Will Deacon
On Mon, Apr 08, 2013 at 05:17:04PM +0100, Marc Zyngier wrote: > Add HYP and S2 page flags, for both normal and device memory. > > Reviewed-by: Christopher Covington > Signed-off-by: Marc Zyngier > --- > arch/arm64/include/asm/pgtable-hwdef.h | 13 + > arch/arm64/include/asm/pgtable.

Re: KVM Guest Lock up (100%) again!

2013-04-10 Thread Gleb Natapov
On Mon, Apr 08, 2013 at 09:02:04PM +0100, Phil Daws wrote: > Hello all, > > Another lock up again this evening :( am wondering whether should consider > upgrading the kernel to 3.7.10 and the latest version of KVM. Thoughts ? > Please try with latest kvm/qemu. This is not the list to report vend

Re: [PATCH v9 7/7] KVM: VMX: Use posted interrupt to deliver virtual interrupt

2013-04-10 Thread Gleb Natapov
On Wed, Apr 10, 2013 at 09:22:57PM +0800, Yang Zhang wrote: > From: Yang Zhang > > If posted interrupt is avaliable, then uses it to inject virtual > interrupt to guest. > > Signed-off-by: Yang Zhang > --- > arch/x86/kvm/lapic.c | 32 +--- > arch/x86/kvm/vmx.c |

Re: [PATCH v9 0/7] KVM: VMX: Add Posted Interrupt supporting

2013-04-10 Thread Gleb Natapov
On Wed, Apr 10, 2013 at 09:22:50PM +0800, Yang Zhang wrote: > From: Yang Zhang > > The follwoing patches are adding the Posted Interrupt supporting to KVM: > The first patch enables the feature 'acknowledge interrupt on vmexit'.Since > it is required by Posted interrupt, we need to enable it firs

KVM host high level of context switching and interrupt per seconds

2013-04-10 Thread Kobi Biton
Hi all, I am using KVM on ubuntu 12.04.02 . full spec: - Dell C6220 , 32G RAM , Software RAID1 500GB x 2 , 12 Cores (24 +Hyper) - Ubuntu server 12.04.02 Kernel 3.5.0.40 / KVM version 1.00 - Using virtio on disk and network vhost_net as kernel module - Using bridge over bond with 2 network inte

Re: [PATCH] KVM: PPC: emulate dcbst

2013-04-10 Thread Scott Wood
On 04/09/2013 10:20:41 PM, Yoder Stuart-B08248 wrote: > -Original Message- > From: Yoder Stuart-B08248 > Sent: Tuesday, April 09, 2013 3:36 PM > To: ag...@suse.de > Cc: kvm-...@vger.kernel.org; kvm@vger.kernel.org; Yoder Stuart-B08248 > Subject: [PATCH] KVM: PPC: emulate dcbst > > From

Re: [PATCH v3 07/32] arm64: KVM: fault injection into a guest

2013-04-10 Thread Will Deacon
On Mon, Apr 08, 2013 at 05:17:09PM +0100, Marc Zyngier wrote: > Implement the injection of a fault (undefined, data abort or > prefetch abort) into a 64bit guest. > > Reviewed-by: Christopher Covington > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/inject_fault.c | 118 >

Re: [PATCH v3 09/32] arm64: KVM: user space interface

2013-04-10 Thread Will Deacon
On Mon, Apr 08, 2013 at 05:17:11PM +0100, Marc Zyngier wrote: > Provide the kvm.h file that defines the user space visible > interface. > > Reviewed-by: Christopher Covington > Signed-off-by: Marc Zyngier > --- > arch/arm64/include/uapi/asm/kvm.h | 117 > ++

Re: [PATCH v3 10/32] arm64: KVM: system register handling

2013-04-10 Thread Will Deacon
On Mon, Apr 08, 2013 at 05:17:12PM +0100, Marc Zyngier wrote: > diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c > new file mode 100644 > index 000..9df3b32 > --- /dev/null > +++ b/arch/arm64/kvm/sys_regs.c > @@ -0,0 +1,871 @@ > +/* > + * Copyright (C) 2012,2013 - ARM Ltd > +

Re: [PATCH v3 11/32] arm64: KVM: CPU specific system registers handling

2013-04-10 Thread Will Deacon
On Mon, Apr 08, 2013 at 05:17:13PM +0100, Marc Zyngier wrote: > Add the support code for CPU specific system registers. Not much > here yet. > > Reviewed-by: Christopher Covington > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/sys_regs_generic_v8.c | 85 >

Re: [PATCH v3 12/32] arm64: KVM: virtual CPU reset

2013-04-10 Thread Will Deacon
On Mon, Apr 08, 2013 at 05:17:14PM +0100, Marc Zyngier wrote: > Provide the reset code for a virtual CPU booted in 64bit mode. > > Reviewed-by: Christopher Covington > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/reset.c | 76 > ++ > 1 file

Re: [PATCH v3 15/32] arm64: KVM: guest one-reg interface

2013-04-10 Thread Will Deacon
On Mon, Apr 08, 2013 at 05:17:17PM +0100, Marc Zyngier wrote: > Let userspace play with the guest registers. > > Reviewed-by: Christopher Covington > Signed-off-by: Marc Zyngier > --- > arch/arm64/kvm/guest.c | 254 > + > 1 file changed, 254 inse

Re: [PATCH 01/11] KVM: nVMX: Stats counters for nVMX

2013-04-10 Thread Abel Gordon
Gleb Natapov wrote on 08/04/2013 01:27:28 PM: > stat counters are deprecated in favor of trace points. Adding kvmnested > trace system is very welcome though. So, should I keep or remove this patch ? If a kvmnested trace system is added then I'll add shadow-vmcs related events -- To unsubscr

Re: [PATCH 03/11] KVM: nVMX: Detect shadow-vmcs capability

2013-04-10 Thread Abel Gordon
Gleb Natapov wrote on 08/04/2013 02:12:07 PM: > > +static inline bool cpu_has_vmx_shadow_vmcs(void) > > +{ > > + u64 vmx_msr; > > + rdmsrl(MSR_IA32_VMX_MISC, vmx_msr); > > + /* check if the cpu supports writing r/o exit information fields */ > > + if (!(vmx_msr & (1u << 29))) > Define

Re: [PATCH 04/11] KVM: nVMX: Introduce vmread and vmwrite bitmaps

2013-04-10 Thread Abel Gordon
Gleb Natapov wrote on 08/04/2013 02:50:54 PM: > > static bool cpu_has_load_ia32_efer; > > static bool cpu_has_load_perf_global_ctrl; > > @@ -4033,6 +4080,8 @@ static int vmx_vcpu_setup(struct vcpu_vm > > vmcs_write64(IO_BITMAP_A, __pa(vmx_io_bitmap_a)); > > vmcs_write64(IO_BITMAP_B,

Re: [PATCH 09/11] KVM: nVMX: Copy VMCS12 to processor-specific shadow vmcs

2013-04-10 Thread Abel Gordon
Gleb Natapov wrote on 09/04/2013 03:47:50 PM: > > > > +static void copy_vmcs12_to_shadow(struct vcpu_vmx *vmx) > > +{ > > + int num_lists = 2; > int num_lists = ARRAY_SIZE(fields) I will fix this. -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a mes

Re: [PATCH 10/11] KVM: nVMX: Synchronize VMCS12 content with the shadow vmcs

2013-04-10 Thread Abel Gordon
Gleb Natapov wrote on 09/04/2013 04:14:35 PM: > On Mon, Mar 11, 2013 at 09:54:47AM +0200, Abel Gordon wrote: > > "Nadav Har'El" wrote on 11/03/2013 12:43:35 AM: > > > > > > > On Sun, Mar 10, 2013, Abel Gordon wrote about "[PATCH 10/11] KVM: > > > nVMX: Synchronize VMCS12 content with the shado

Re: [PATCH 05/11] KVM: nVMX: Refactor handle_vmwrite

2013-04-10 Thread Abel Gordon
Gleb Natapov wrote on 09/04/2013 02:05:07 PM: > > +static inline bool vmcs12_write_any(struct kvm_vcpu *vcpu, > > +unsigned long field, u64 field_value){ > > + short offset = vmcs_field_to_offset(field); > > + char *p = ((char *) get_vmcs12(vcpu)) + offset; > > + if (offse

Re: [PATCH v2 0/4] tcm_vhost fix cmd leak and send bad target

2013-04-10 Thread Nicholas A. Bellinger
On Wed, 2013-04-10 at 15:06 +0800, Asias He wrote: > v2: > - Fix the order of out and head parameter. > > Asias He (4): > tcm_vhost: Remove double check of response > tcm_vhost: Fix tv_cmd leak in vhost_scsi_handle_vq > tcm_vhost: Add vhost_scsi_send_bad_target() helper > tcm_vhost: Send b

Re: [PATCH] KVM: PPC: emulate dcbst

2013-04-10 Thread Alexander Graf
On 09.04.2013, at 22:36, Stuart Yoder wrote: > From: Stuart Yoder > > Signed-off-by: Stuart Yoder Thanks, applied to kvm-ppc-queue. Alex -- 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://vg

Re: [PATCH 2/7 v3] Rename EMULATE_DO_PAPR to EMULATE_EXIT_USER

2013-04-10 Thread Alexander Graf
On 10.04.2013, at 00:37, Paul Mackerras wrote: > On Mon, Apr 08, 2013 at 04:02:13PM +0530, Bharat Bhushan wrote: >> Instruction emulation return EMULATE_DO_PAPR when it requires >> exit to userspace on book3s. Similar return is required >> for booke. EMULATE_DO_PAPR reads out to be confusing so i

[PATCH -v2] kvm: Emulate MOVBE

2013-04-10 Thread Borislav Petkov
On Wed, Apr 10, 2013 at 03:16:39PM +0300, Gleb Natapov wrote: > Right, the question is how kernel can tell QEMU that the cpuid bit is > supported but should not be set unless explicitly asked by an user. Actually, this seems to work with the patch below based on whether you have "+movbe" in the -c

RE: [PATCH v9 7/7] KVM: VMX: Use posted interrupt to deliver virtual interrupt

2013-04-10 Thread Zhang, Yang Z
Gleb Natapov wrote on 2013-04-10: > On Wed, Apr 10, 2013 at 09:22:57PM +0800, Yang Zhang wrote: >> From: Yang Zhang >> >> If posted interrupt is avaliable, then uses it to inject virtual >> interrupt to guest. >> >> Signed-off-by: Yang Zhang >> --- >> arch/x86/kvm/lapic.c | 32 ++

RE: [PATCH v9 0/7] KVM: VMX: Add Posted Interrupt supporting

2013-04-10 Thread Zhang, Yang Z
Gleb Natapov wrote on 2013-04-10: > On Wed, Apr 10, 2013 at 09:22:50PM +0800, Yang Zhang wrote: >> From: Yang Zhang >> >> The follwoing patches are adding the Posted Interrupt supporting to KVM: >> The first patch enables the feature 'acknowledge interrupt on vmexit'.Since >> it is required by Po

Re: [PATCH v9 0/7] KVM: VMX: Add Posted Interrupt supporting

2013-04-10 Thread Gleb Natapov
On Thu, Apr 11, 2013 at 01:03:30AM +, Zhang, Yang Z wrote: > Gleb Natapov wrote on 2013-04-10: > > On Wed, Apr 10, 2013 at 09:22:50PM +0800, Yang Zhang wrote: > >> From: Yang Zhang > >> > >> The follwoing patches are adding the Posted Interrupt supporting to KVM: > >> The first patch enables

[PATCH 6/8] KVM: PPC: Book3S: Add support for ibm,int-on/off RTAS calls

2013-04-10 Thread Paul Mackerras
This adds support for the ibm,int-on and ibm,int-off RTAS calls to the in-kernel XICS emulation and corrects the handling of the saved priority by the ibm,set-xive RTAS call. With this, ibm,int-off sets the specified interrupt's priority in its saved_priority field and sets the priority to 0xff (t

[PATCH v4 0/8] In-kernel XICS interrupt controller emulation

2013-04-10 Thread Paul Mackerras
This is a repost of my patch series implementing in-kernel emulation of the XICS interrupt controller architecture defined in PAPR (Power Architecture Platform Requirements, the document that defines IBM's pSeries platform architecture). This version of the patch series uses the device API as post

[PATCH 7/8] KVM: PPC: Book3S: Facilities to save/restore XICS presentation ctrler state

2013-04-10 Thread Paul Mackerras
This adds the ability for userspace to save and restore the state of the XICS interrupt presentation controllers (ICPs) via the KVM_GET/SET_ONE_REG interface. Since there is one ICP per vcpu, we simply define a new 64-bit register in the ONE_REG space for the ICP state. The state includes the CPU

[PATCH 3/8] KVM: PPC: Book3S HV: Speed up wakeups of CPUs on HV KVM

2013-04-10 Thread Paul Mackerras
From: Benjamin Herrenschmidt Currently, we wake up a CPU by sending a host IPI with smp_send_reschedule() to thread 0 of that core, which will take all threads out of the guest, and cause them to re-evaluate their interrupt status on the way back in. This adds a mechanism to differentiate real h

[PATCH 5/8] KVM: PPC: Book3S HV: Improve real-mode handling of external interrupts

2013-04-10 Thread Paul Mackerras
This streamlines our handling of external interrupts that come in while we're in the guest. First, when waking up a hardware thread that was napping, we split off the "napping due to H_CEDE" case earlier, and use the code that handles an external interrupt (0x500) in the guest to handle that too.

[PATCH 2/8] KVM: PPC: Book3S: Add kernel emulation for the XICS interrupt controller

2013-04-10 Thread Paul Mackerras
From: Benjamin Herrenschmidt This adds in-kernel emulation of the XICS (eXternal Interrupt Controller Specification) interrupt controller specified by PAPR, for both HV and PR KVM guests. The XICS emulation supports up to 1048560 interrupt sources. Interrupt source numbers below 16 are reserved;

[PATCH 8/8] KVM: PPC: Book 3S: Add API for in-kernel XICS emulation

2013-04-10 Thread Paul Mackerras
This adds the API for userspace to instantiate an XICS device in a VM and connect VCPUs to it. The API consists of a new device type for the KVM_CREATE_DEVICE ioctl, a new capability KVM_CAP_IRQ_XICS, which functions similarly to KVM_CAP_IRQ_MPIC, and the KVM_IRQ_LINE ioctl, which is used to asser

[PATCH 4/8] KVM: PPC: Book3S HV: Add support for real mode ICP in XICS emulation

2013-04-10 Thread Paul Mackerras
From: Benjamin Herrenschmidt This adds an implementation of the XICS hypercalls in real mode for HV KVM, which allows us to avoid exiting the guest MMU context on all threads for a variety of operations such as fetching a pending interrupt, EOI of messages, IPIs, etc. Signed-off-by: Benjamin Her

[PATCH 1/8] KVM: PPC: Book3S: Add infrastructure to implement kernel-side RTAS calls

2013-04-10 Thread Paul Mackerras
From: Michael Ellerman For pseries machine emulation, in order to move the interrupt controller code to the kernel, we need to intercept some RTAS calls in the kernel itself. This adds an infrastructure to allow in-kernel handlers to be registered for RTAS services by name. A new ioctl, KVM_PPC_

RE: [PATCH v9 0/7] KVM: VMX: Add Posted Interrupt supporting

2013-04-10 Thread Zhang, Yang Z
Gleb Natapov wrote on 2013-04-11: > On Thu, Apr 11, 2013 at 01:03:30AM +, Zhang, Yang Z wrote: >> Gleb Natapov wrote on 2013-04-10: >>> On Wed, Apr 10, 2013 at 09:22:50PM +0800, Yang Zhang wrote: From: Yang Zhang The follwoing patches are adding the Posted Interrupt supporting

Re: [PATCH 01/11] KVM: nVMX: Stats counters for nVMX

2013-04-10 Thread Gleb Natapov
On Wed, Apr 10, 2013 at 10:08:56PM +0300, Abel Gordon wrote: > > > Gleb Natapov wrote on 08/04/2013 01:27:28 PM: > > > > stat counters are deprecated in favor of trace points. Adding kvmnested > > trace system is very welcome though. > > So, should I keep or remove this patch ? Remove. > If

Re: [PATCH 10/11] KVM: nVMX: Synchronize VMCS12 content with the shadow vmcs

2013-04-10 Thread Gleb Natapov
On Wed, Apr 10, 2013 at 10:15:37PM +0300, Abel Gordon wrote: > > > Gleb Natapov wrote on 09/04/2013 04:14:35 PM: > > > On Mon, Mar 11, 2013 at 09:54:47AM +0200, Abel Gordon wrote: > > > "Nadav Har'El" wrote on 11/03/2013 12:43:35 > AM: > > > > > > > > > > On Sun, Mar 10, 2013, Abel Gordon wrot