[PATCH] vhost_net: remove tx polling state

2013-04-11 Thread Jason Wang
After commit 2b8b328b61c799957a456a5a8dab8cc7dea68575 (vhost_net: handle polling errors when setting backend), we in fact track the polling state through poll->wqh, so there's no need to duplicate the work with an extra vhost_net_polling_state. So this patch removes this and make the code simpler.

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

2013-04-11 Thread Gleb Natapov
On Wed, Apr 10, 2013 at 09:22:20PM +0800, Yang Zhang wrote: > 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 pen

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

2013-04-11 Thread Zhang, Yang Z
Gleb Natapov wrote on 2013-04-11: > On Wed, Apr 10, 2013 at 09:22:20PM +0800, Yang Zhang wrote: >> 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: >> Whe

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

2013-04-11 Thread Gleb Natapov
On Thu, Apr 11, 2013 at 07:54:01AM +, Zhang, Yang Z wrote: > Gleb Natapov wrote on 2013-04-11: > > On Wed, Apr 10, 2013 at 09:22:20PM +0800, Yang Zhang wrote: > >> From: Yang Zhang > >> > >> Current interrupt coalescing logci which only used by RTC has conflict > >> with Posted Interrupt. > >

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

2013-04-11 Thread Zhang, Yang Z
Gleb Natapov wrote on 2013-04-11: > On Thu, Apr 11, 2013 at 07:54:01AM +, Zhang, Yang Z wrote: >> Gleb Natapov wrote on 2013-04-11: >>> On Wed, Apr 10, 2013 at 09:22:20PM +0800, Yang Zhang wrote: From: Yang Zhang Current interrupt coalescing logci which only used by RTC has con

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

2013-04-11 Thread Michael S. Tsirkin
On Wed, Apr 10, 2013 at 02:19:02PM -0700, Nicholas A. Bellinger wrote: > 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_h

Re: [PATCH] vhost_net: remove tx polling state

2013-04-11 Thread Michael S. Tsirkin
On Thu, Apr 11, 2013 at 02:50:48PM +0800, Jason Wang wrote: > After commit 2b8b328b61c799957a456a5a8dab8cc7dea68575 (vhost_net: handle > polling > errors when setting backend), we in fact track the polling state through > poll->wqh, so there's no need to duplicate the work with an extra > vhost_ne

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

2013-04-11 Thread Asias He
On Thu, Apr 11, 2013 at 10:22:33AM +0300, Michael S. Tsirkin wrote: > On Wed, Apr 10, 2013 at 02:19:02PM -0700, Nicholas A. Bellinger wrote: > > 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

Re: [Qemu-devel] reply: reply: qemu crashed when starting vm(kvm) with vnc connect

2013-04-11 Thread Stefan Hajnoczi
On Mon, Apr 08, 2013 at 12:27:06PM +, Zhanghaoyu (A) wrote: > On Sun, Apr 07, 2013 at 04:58:07AM +, Zhanghaoyu (A) wrote: > > >>> I start a kvm VM with vnc(using the zrle protocol) connect, sometimes > > >>> qemu program crashed during starting period, received signal SIGABRT. > > >>> Tryi

[PATCH 2/8 v3] KVM: PPC: e500: Expose MMU registers via ONE_REG

2013-04-11 Thread Mihai Caraman
MMU registers were exposed to user-space using sregs interface. Add them to ONE_REG interface using kvmppc_get_one_reg/kvmppc_set_one_reg delegation mechanism. Signed-off-by: Mihai Caraman --- v3: - Fix case breaks v2: - Restrict set_one_reg operation for MMU registers to HW values Document

[PATCH 3/8 v3] KVM: PPC: e500: Move vcpu's MMU configuration to dedicated functions

2013-04-11 Thread Mihai Caraman
Vcpu's MMU default configuration and geometry update logic was buried in a chunk of code. Move them to dedicated functions to add more clarity. Signed-off-by: Mihai Caraman --- v3: - No change v2: - Add better patch description arch/powerpc/kvm/e500_mmu.c | 60 +++--

[PATCH 6/8 v3] KVM: PPC: e500: Remove E.PT and E.HV.LRAT categories from VCPUs

2013-04-11 Thread Mihai Caraman
Embedded.Page Table (E.PT) category is not supported yet in e6500 kernel. Configure TLBnCFG to remove E.PT and E.HV.LRAT categories from VCPUs. Signed-off-by: Mihai Caraman --- v3: - No change arch/powerpc/kvm/e500_mmu.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git

[PATCH 4/8 v3] KVM: PPC: e500: Add support for TLBnPS registers

2013-04-11 Thread Mihai Caraman
Add support for TLBnPS registers available in MMU Architecture Version (MAV) 2.0. Signed-off-by: Mihai Caraman --- v3: - Add vcpu_ftr enum v2: - Add vcpu generic function has_feature() Documentation/virtual/kvm/api.txt |4 arch/powerpc/include/asm/kvm_host.h |1 + arch/powerp

[PATCH 8/8 v3] KVM: PPC: e500: Add e6500 core to Kconfig description

2013-04-11 Thread Mihai Caraman
Add e6500 core to Kconfig description. Signed-off-by: Mihai Caraman --- v3: - No change arch/powerpc/kvm/Kconfig |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig index 63c67ec..4489520 100644 --- a/arch/powerpc/kv

[PATCH 7/8 v3] KVM: PPC: e500mc: Enable e6500 cores

2013-04-11 Thread Mihai Caraman
Extend processor compatibility names to e6500 cores. Signed-off-by: Mihai Caraman Reviewed-by: Alexander Graf --- v3: - No change arch/powerpc/kvm/e500mc.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c index ab0

[PATCH 5/8] KVM: PPC: e500: Add support for EPTCFG register

2013-04-11 Thread Mihai Caraman
EPTCFG register defined by E.PT is accessed unconditionally by Linux guests in the presence of MAV 2.0. Emulate it now. Signed-off-by: Mihai Caraman --- v3: - Initialize EPTCFG to 0 since E.PT is not supported now Documentation/virtual/kvm/api.txt |1 + arch/powerpc/include/asm/kvm_host.

[PATCH 1/8 v3] KVM: PPC: Book3E: Refactor ONE_REG ioctl implementation

2013-04-11 Thread Mihai Caraman
Refactor Book3E ONE_REG ioctl implementation to use kvmppc_get_one_reg/ kvmppc_set_one_reg delegation interface introduced by Book3S. This is necessary for MMU SPRs which are platform specifics. Get rid of useless case braces in the process. Signed-off-by: Mihai Caraman --- v3: - Split ONE_REG

[PATCH 0/8 v3] KVM: PPC: e500: Enable FSL e6500 core

2013-04-11 Thread Mihai Caraman
Enable basic support for Freescale e6500 core, adding MAV 2.0 support. Validated on T4240QDS platfrom. Altivec, Multithreading and HW Tablewalk are not addressed by this patchset. Mihai Caraman (8): KVM: PPC: Book3E: Refactor ONE_REG ioctl implementation KVM: PPC: e500: Expose MMU registers vi

[PATCH 3/4] KVM: emulator: Do not fail on emulation of undefined opcode

2013-04-11 Thread Gleb Natapov
Emulation of undefined opcode should inject #UD instead of causing emulation failure. Do that by moving Undefined flag check to emulation stage and injection #UD there. Signed-off-by: Gleb Natapov --- arch/x86/kvm/emulate.c |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --gi

[PATCH 4/4] KVM: emulator: mark 0xff 0x7d opcode as undefined.

2013-04-11 Thread Gleb Natapov
Signed-off-by: Gleb Natapov --- arch/x86/kvm/emulate.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 2f66e98..5a44d7f 100644 --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -3714,7 +3714,7 @@ static const

[PATCH 1/4] KVM: emulator: fix unimplemented instruction detection

2013-04-11 Thread Gleb Natapov
Unimplemented instruction detection is broken for group instructions since it relies on "flags" field of opcode to be zero, but all instructions in a group inherit flags from a group encoding. Fix that by having a separate flag for unimplemented instructions. Signed-off-by: Gleb Natapov --- arch

[PATCH 2/4] KVM: VMX: do not try to reexecute failed instruction while emulating invalid guest state

2013-04-11 Thread Gleb Natapov
During invalid guest state emulation vcpu cannot enter guest mode to try to reexecute instruction that emulator failed to emulate, so emulation will happen again and again. Prevent that by telling the emulator that instruction reexecution should not be attempted. Signed-off-by: Gleb Natapov ---

Re: [PATCH] tcm_vhost: Wait for pending requests in vhost_scsi_flush()

2013-04-11 Thread Michael S. Tsirkin
On Tue, Apr 09, 2013 at 05:39:43PM +0800, Asias He wrote: > This patch makes vhost_scsi_flush() wait for all the pending requests > issued before the flush operation to be finished. > > Changes in v3: > - Rebase > - Drop 'tcm_vhost: Wait for pending requests in > vhost_scsi_clear_endpoint()' in

Re: [PATCH v3 4/5] KVM: nVMX: Fix conditions for interrupt injection

2013-04-11 Thread Gleb Natapov
On Sun, Mar 24, 2013 at 07:44:47PM +0100, Jan Kiszka wrote: > From: Jan Kiszka > > If we are in guest mode, L0 can only inject events into L2 if L1 has > nothing pending. Otherwise, L0 would overwrite L1's events and they > would get lost. But even if no injection of L1 is pending, we do not > wa

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

2013-04-11 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

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

2013-04-11 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 v10 1/7] KVM: Add vcpu info to ioapic_update_eoi()

2013-04-11 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 v10 2/7] KVM: Introduce struct rtc_status

2013-04-11 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 v10 3/7] KVM: Return destination vcpu on interrupt injection

2013-04-11 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 v10 5/7] KVM: Force vmexit with virtual interrupt delivery

2013-04-11 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 v10 6/7] KVM: Let ioapic know the irq line status

2013-04-11 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 v10 7/7] KVM: Use eoi to track RTC interrupt delivery status

2013-04-11 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 v10 4/7] KVM: Add reset/restore rtc_status support

2013-04-11 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 v10 0/7] KVM: VMX: Add Posted Interrupt supporting

2013-04-11 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 v10 1/7] KVM: VMX: Enable acknowledge interupt on vmexit

2013-04-11 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 v10 2/7] KVM: VMX: Register a new IPI for posted interrupt

2013-04-11 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 v10 3/7] KVM: VMX: Check the posted interrupt capability

2013-04-11 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 v10 4/7] KVM: Call common update function when ioapic entry changed.

2013-04-11 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 |2 +- arch/x8

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

2013-04-11 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 v10 6/7] KVM: VMX: Add the algorithm of deliver posted interrupt

2013-04-11 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

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

2013-04-11 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 | 30 +++--- arch/x86/kvm/vmx.c |2 +- arch/x86/kvm/x86.c |1 + 3 files changed, 21 insertions(+), 12 d

[PATCH] KVM: x86 emulator: Fix segment loading in VM86

2013-04-11 Thread Kevin Wolf
This fixes a regression introduced in commit 03ebebeb1 ("KVM: x86 emulator: Leave segment limit and attributs alone in real mode"). The mentioned commit changed the segment descriptors for both real mode and VM86 to only update the segment base instead of creating a completely new descriptor with

Re: [PATCH] KVM: x86 emulator: Fix segment loading in VM86

2013-04-11 Thread Gleb Natapov
On Thu, Apr 11, 2013 at 02:06:03PM +0200, Kevin Wolf wrote: > This fixes a regression introduced in commit 03ebebeb1 ("KVM: x86 > emulator: Leave segment limit and attributs alone in real mode"). > > The mentioned commit changed the segment descriptors for both real mode > and VM86 to only update

Re: RFC: vfio API changes needed for powerpc (v3)

2013-04-11 Thread Joerg Roedel
On Tue, Apr 09, 2013 at 01:22:15AM +, Yoder Stuart-B08248 wrote: > > What happens if a normal unmap call is done on the MSI iova? Do we > > need a separate unmap? > > I was thinking a normal unmap on an MSI windows would be an error...but > I'm not set on that. I put the msi unmap there to

Re: [PULL 0/7] ppc patch queue 2013-03-22

2013-04-11 Thread Marcelo Tosatti
On Tue, Mar 26, 2013 at 12:59:04PM +1100, Paul Mackerras wrote: > On Tue, Mar 26, 2013 at 03:33:12AM +0200, Gleb Natapov wrote: > > On Tue, Mar 26, 2013 at 12:35:09AM +0100, Alexander Graf wrote: > > > I agree. So if it doesn't hurt to have the same commits in kvm/next and > > > kvm/master, I'd be

Re: [PULL 0/7] ppc patch queue 2013-03-22

2013-04-11 Thread Alexander Graf
On 11.04.2013, at 15:45, Marcelo Tosatti wrote: > On Tue, Mar 26, 2013 at 12:59:04PM +1100, Paul Mackerras wrote: >> On Tue, Mar 26, 2013 at 03:33:12AM +0200, Gleb Natapov wrote: >>> On Tue, Mar 26, 2013 at 12:35:09AM +0100, Alexander Graf wrote: I agree. So if it doesn't hurt to have the sa

Re: [PATCH v3 4/5] KVM: nVMX: Fix conditions for interrupt injection

2013-04-11 Thread Jan Kiszka
On 2013-04-11 13:20, Gleb Natapov wrote: > On Sun, Mar 24, 2013 at 07:44:47PM +0100, Jan Kiszka wrote: >> From: Jan Kiszka >> >> If we are in guest mode, L0 can only inject events into L2 if L1 has >> nothing pending. Otherwise, L0 would overwrite L1's events and they >> would get lost. But even i

Re: [PATCH -v2] kvm: Emulate MOVBE

2013-04-11 Thread Gleb Natapov
On Thu, Apr 11, 2013 at 02:18:15AM +0200, Borislav Petkov wrote: > 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 seem

Re: [PATCH v3 4/5] KVM: nVMX: Fix conditions for interrupt injection

2013-04-11 Thread Gleb Natapov
On Thu, Apr 11, 2013 at 04:27:23PM +0200, Jan Kiszka wrote: > On 2013-04-11 13:20, Gleb Natapov wrote: > > On Sun, Mar 24, 2013 at 07:44:47PM +0100, Jan Kiszka wrote: > >> From: Jan Kiszka > >> > >> If we are in guest mode, L0 can only inject events into L2 if L1 has > >> nothing pending. Otherwis

[PATCH 3/4] kvm/ppc/e500: g2h_tlb1_map: clear old bit before setting new bit

2013-04-11 Thread Alexander Graf
From: Scott Wood It's possible that we're using the same host TLB1 slot to map (a presumably different portion of) the same guest TLB1 entry. Clear the bit in the map before setting it, so that if the esels are the same the bit will remain set. Signed-off-by: Scott Wood Signed-off-by: Alexande

[PATCH 4/4] kvm/ppc/e500: eliminate tlb_refs

2013-04-11 Thread Alexander Graf
From: Scott Wood Commit 523f0e5421c12610527c620b983b443f329e3a32 ("KVM: PPC: E500: Explicitly mark shadow maps invalid") began using E500_TLB_VALID for guest TLB1 entries, and skipping invalidations if it's not set. However, when E500_TLB_VALID was set for such entries, it was on a fake local re

[PULL 3.9 0/4] ppc patch queue 2013-04-11 for 3.9

2013-04-11 Thread Alexander Graf
Hi Marcelo / Gleb, This is my current patch queue for ppc against master for 3.9. Please pull. This patch set contains a number of patches fixing regressions in e500 KVM code. Some of these patches (the top 3 ones) also went into kvm/next by accident, so there will be duplicate git commits with

[PATCH 2/4] kvm/ppc/e500: h2g_tlb1_rmap: esel 0 is valid

2013-04-11 Thread Alexander Graf
From: Scott Wood Add one to esel values in h2g_tlb1_rmap, so that "no mapping" can be distinguished from "esel 0". Note that we're not saved by the fact that host esel 0 is reserved for non-KVM use, because KVM host esel numbering is not the raw host numbering (see to_htlb1_esel). Signed-off-by

[PATCH 1/4] kvm/powerpc/e500mc: fix tlb invalidation on cpu migration

2013-04-11 Thread Alexander Graf
From: Scott Wood The existing check handles the case where we've migrated to a different core than we last ran on, but it doesn't handle the case where we're still on the same cpu we last ran on, but some other vcpu has run on this cpu in the meantime. Without this, guest segfaults (and other mi

Re: [PATCH -v2] kvm: Emulate MOVBE

2013-04-11 Thread Borislav Petkov
On Thu, Apr 11, 2013 at 05:28:18PM +0300, Gleb Natapov wrote: > On Thu, Apr 11, 2013 at 02:18:15AM +0200, Borislav Petkov wrote: > > 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 n

Re: KVM: x86: drop alignment checks from KVM_MSR_SYSTEM_TIME address

2013-04-11 Thread Marcelo Tosatti
On Sat, Mar 23, 2013 at 04:12:11PM +0200, Gleb Natapov wrote: > On Fri, Mar 22, 2013 at 05:17:38PM -0700, Andrew Honig wrote: > > kvm_write_guest would work, but it will hurt performance a bit because > > it'll be doing the address translation each time the time is updated, > > which happens on mos

RE: RFC: vfio API changes needed for powerpc (v3)

2013-04-11 Thread Yoder Stuart-B08248
> -Original Message- > From: Joerg Roedel [mailto:j...@8bytes.org] > Sent: Thursday, April 11, 2013 7:57 AM > To: Yoder Stuart-B08248 > Cc: Wood Scott-B07421; kvm@vger.kernel.org; qemu-de...@nongnu.org; > io...@lists.linux-foundation.org; > ag...@suse.de; Bhushan Bharat-R65777 > Subject:

[PATCH 0/5] Usual batch of random ARM fixes for kvmtool

2013-04-11 Thread Will Deacon
Hello folks, Here's the latest round of ARM fixes and updates for kvmtool. Most of this is confined to the arm/ subdirectory, with the exception of a fix to the virtio-mmio vq definitions due to the multi-queue work from Sasha. I'm not terribly happy about that code though, since it seriously incr

[PATCH 3/5] kvm tools: arm: consolidate CPU node generation

2013-04-11 Thread Will Deacon
From: Marc Zyngier Now that generate_cpu_nodes uses the cpu_compatible field to output the compatible property, we can unify the A15 and A57 implementations, as they are strictly identical. Move the function to fdt.c, together with most of the device tree generation. Signed-off-by: Marc Zyngier

[PATCH 5/5] kvm tools: bump number of virtio MMIO vqueues

2013-04-11 Thread Will Deacon
Commit 4d789d4a2050 ("kvm tools: Increase amount of possible interrupts per PCI device") increased the maximum amount of virtio queues for the PCI transport, but neglected to do the same for MMIO. This patch makes the same change for virtio-mmio. Cc: Sasha Levin Reported-by: Marc Zyngier Signed

[PATCH 2/5] kvm tools: arm: add CPU compatible string to target structure

2013-04-11 Thread Will Deacon
From: Marc Zyngier Instead of hardcoding the CPU compatible string, store it in the target descriptor. This allows similar CPUs to be managed by the same backend, and yet have different compatible properties. Also remove a check for a condition that can never occur in both A15 and A57 backends.

[PATCH 4/5] kvm tools: arm64: add support for AEM and Foundation models

2013-04-11 Thread Will Deacon
From: Marc Zyngier The ARMv8 architecture is supported by two publicly available software models: the Architecture Enveloppe Model, and the Foundation model. Both are fairly similar to the Cortex-A57 from a kvm tools point of view, so we can hijack the A57 implementation to register these new ta

[PATCH 1/5] kvm tools: arm: don't crash when no compatible CPU is found

2013-04-11 Thread Will Deacon
From: Marc Zyngier If the kernel against which kvm tools was compiled supports more CPU types than kvm tools does, then we can hit a situation where we dereference an empty target slot. Just stepping over empty slots fixes the issue. Signed-off-by: Marc Zyngier Signed-off-by: Will Deacon ---

Re: [PATCH 0/5] Usual batch of random ARM fixes for kvmtool

2013-04-11 Thread Sasha Levin
On 04/11/2013 12:36 PM, Will Deacon wrote: > Without multi-queue, we can boot Debian Wheezy to a prompt in 38MB. With > the new changes, that increases to 170MB! Any chance we can try and tackle > this regression please? I keep getting bitten by the OOM killer :( That's definitely unwanted. I'll

Re: kvmtool : [PATCH] PowerPc : Fix compilation for ppc64

2013-04-11 Thread Prerna Saxena
On 04/10/2013 09:05 PM, Sasha Levin wrote: > Hm, what would LD create before this patch? I thought that the default > would be to create a binary that corresponds to the platform you're > building in, so if you build on ppc64 you'd get ppc64 binaries, no? > Hi Sasha, Thanks for the prompt respons

Re: [PATCH] bookehv: Handle debug exception on guest exit

2013-04-11 Thread Kumar Gala
On Apr 5, 2013, at 2:53 AM, Bhushan Bharat-R65777 wrote: > Hi Kumar/Benh, > > After further looking into the code I think that if we correct the vector > range below in DebugDebug handler then we do not need the change I provided > in this patch. > > Here is the snapshot for 32 bit (head_book

Re: [PATCH] bookehv: Handle debug exception on guest exit

2013-04-11 Thread Stuart Yoder
On Thu, Apr 11, 2013 at 1:33 PM, Kumar Gala wrote: > > On Apr 5, 2013, at 2:53 AM, Bhushan Bharat-R65777 wrote: > >> Hi Kumar/Benh, >> >> After further looking into the code I think that if we correct the vector >> range below in DebugDebug handler then we do not need the change I provided >> in

Re: [PATCH] bookehv: Handle debug exception on guest exit

2013-04-11 Thread Stuart Yoder
So the patch should look something like this (on a 3.8 kernel): diff --git a/arch/powerpc/kernel/head_booke.h b/arch/powerpc/kernel/head_booke.h index 5f051ee..92b675a 100644 --- a/arch/powerpc/kernel/head_booke.h +++ b/arch/powerpc/kernel/head_booke.h @@ -286,13 +286,13 @@ label: andis.

Re: kvmtool : [PATCH] PowerPc : Fix compilation for ppc64

2013-04-11 Thread Sasha Levin
On 04/11/2013 12:53 PM, Prerna Saxena wrote: > On 04/10/2013 09:05 PM, Sasha Levin wrote: >> Hm, what would LD create before this patch? I thought that the default >> would be to create a binary that corresponds to the platform you're >> building in, so if you build on ppc64 you'd get ppc64 binarie

Re: RFC: vfio API changes needed for powerpc (v3)

2013-04-11 Thread Scott Wood
On 04/11/2013 07:56:59 AM, Joerg Roedel wrote: On Tue, Apr 09, 2013 at 01:22:15AM +, Yoder Stuart-B08248 wrote: > > What happens if a normal unmap call is done on the MSI iova? Do we > > need a separate unmap? > > I was thinking a normal unmap on an MSI windows would be an error...but >

virtio-net mq vq initialization (was: [PATCH 0/5] Usual batch of random ARM fixes for kvmtool)

2013-04-11 Thread Sasha Levin
On 04/11/2013 12:36 PM, Will Deacon wrote: > Hello folks, > > Here's the latest round of ARM fixes and updates for kvmtool. Most of > this is confined to the arm/ subdirectory, with the exception of a fix > to the virtio-mmio vq definitions due to the multi-queue work from > Sasha. I'm not terribl

Re: [PATCH] vhost_net: remove tx polling state

2013-04-11 Thread David Miller
From: "Michael S. Tsirkin" Date: Thu, 11 Apr 2013 10:24:30 +0300 > On Thu, Apr 11, 2013 at 02:50:48PM +0800, Jason Wang wrote: >> After commit 2b8b328b61c799957a456a5a8dab8cc7dea68575 (vhost_net: handle >> polling >> errors when setting backend), we in fact track the polling state through >> pol

Re: [PATCH 1/9] powerpc,kvm: fix imbalance srcu_read_[un]lock()

2013-04-11 Thread Paul E. McKenney
On Mon, Mar 18, 2013 at 08:26:48AM +1100, Paul Mackerras wrote: > On Sat, Mar 16, 2013 at 12:50:49AM +0800, Lai Jiangshan wrote: > > At the point of up_out label in kvmppc_hv_setup_htab_rma(), > > srcu read lock is still held. > > > > We have to release it before return. > > > > Signed-off-by: La

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

2013-04-11 Thread Paul Mackerras
I wrote: > The series is based on Alex Graf's kvm-ppc-next branch with Scott > Wood's recent patch series applied on top, together with the patch > below to allow it to compile with CONFIG_KVM_MPIC=n. And of course I forgot to include the patch. Here it is. Paul. diff --git a/arch/powerpc/kvm/p

Re: [PATCH] tcm_vhost: Wait for pending requests in vhost_scsi_flush()

2013-04-11 Thread Asias He
On Thu, Apr 11, 2013 at 01:47:21PM +0300, Michael S. Tsirkin wrote: > On Tue, Apr 09, 2013 at 05:39:43PM +0800, Asias He wrote: > > This patch makes vhost_scsi_flush() wait for all the pending requests > > issued before the flush operation to be finished. > > > > Changes in v3: > > - Rebase > > -

[PATCH] kvm tools: set "done" to true on SDL window close

2013-04-11 Thread Lin Ming
Currently, SDL doesn't exit on window close because it stuck in sdl__stop because "done" is not set to true. Fix it by setting "done" to true on window close. Signed-off-by: Lin Ming --- tools/kvm/ui/sdl.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/tools/kvm/ui/sdl

Re: [PATCH 0/5] Usual batch of random ARM fixes for kvmtool

2013-04-11 Thread Pekka Enberg
On 04/11/2013 12:36 PM, Will Deacon wrote: Without multi-queue, we can boot Debian Wheezy to a prompt in 38MB. With the new changes, that increases to 170MB! Any chance we can try and tackle this regression please? I keep getting bitten by the OOM killer :( On 04/11/2013 07:45 PM, Sasha Levin w