Re: [PATCH] KVM: x86: Avoid busy loops over uninjectable pending APIC timers

2013-03-17 Thread Gleb Natapov
On Sat, Mar 16, 2013 at 09:49:07PM +0100, Jan Kiszka wrote: > From: Jan Kiszka > > If the guest didn't take the last APIC timer interrupt yet and generates > another one on top, e.g. via periodic mode, we do not block the VCPU > even if the guest state is halted. The reason is that > apic_has_pen

Re: [PATCH 1/2] virtio-scsi: Set _DRIVER_OK flag before scsi target scanning

2013-03-17 Thread Michael S. Tsirkin
On Fri, Mar 15, 2013 at 09:45:15AM +0800, Asias He wrote: > Before we start scsi target scanning, we need to set the > VIRTIO_CONFIG_S_DRIVER_OK flag so the device can do setup properly. > > This fix a bug when booting tcm_vhost with seabios. > > Signed-off-by: Asias He > Acked-by: Paolo Bonzini

Re: [PATCH 2/2] virtio-scsi: Pack struct virtio_scsi_{req_cmd,resp_cmd}

2013-03-17 Thread Michael S. Tsirkin
On Fri, Mar 15, 2013 at 09:45:16AM +0800, Asias He wrote: > Device needs the exact size of these data structure. Prevent padding. > > This fixes guest hang when booting seabios + tcm_vhost. > > Signed-off-by: Asias He Acked-by: Michael S. Tsirkin > --- > src/virtio-scsi.h | 4 ++-- > 1 file

Re: [PATCH 4/5] KVM: register rtc eoi notifier

2013-03-17 Thread Gleb Natapov
On Fri, Mar 15, 2013 at 04:04:59PM +0800, Yang Zhang wrote: > From: Yang Zhang > > when virtual interrupt delivery avaliable, register a rtc eoi notifier > to force vmexit when writing eoi for rtc interupt > > Signed-off-by: Yang Zhang > --- > virt/kvm/ioapic.c | 26 +

Re: [PATCH 5/5] KVM: use eoi to track RTC interrupt delivery status

2013-03-17 Thread Gleb Natapov
On Fri, Mar 15, 2013 at 04:05:00PM +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 nee

Re: [PATCH] KVM: x86: Avoid busy loops over uninjectable pending APIC timers

2013-03-17 Thread Jan Kiszka
On 2013-03-17 09:47, Gleb Natapov wrote: > On Sat, Mar 16, 2013 at 09:49:07PM +0100, Jan Kiszka wrote: >> From: Jan Kiszka >> >> If the guest didn't take the last APIC timer interrupt yet and generates >> another one on top, e.g. via periodic mode, we do not block the VCPU >> even if the guest sta

[PATCH] vmxcap: Update according to SDM of January 2013

2013-03-17 Thread Jan Kiszka
From: Jan Kiszka This adds reporting of VMCS shadowing, #VE, IA32_SMBASE, unrestricted VMWRITE and fixes the range of the MSEG revision ID. Signed-off-by: Jan Kiszka --- scripts/kvm/vmxcap |6 +- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/scripts/kvm/vmxcap b/script

Re: [PATCH] KVM: x86: Avoid busy loops over uninjectable pending APIC timers

2013-03-17 Thread Gleb Natapov
On Sun, Mar 17, 2013 at 11:45:34AM +0100, Jan Kiszka wrote: > On 2013-03-17 09:47, Gleb Natapov wrote: > > On Sat, Mar 16, 2013 at 09:49:07PM +0100, Jan Kiszka wrote: > >> From: Jan Kiszka > >> > >> If the guest didn't take the last APIC timer interrupt yet and generates > >> another one on top, e

Re: [PATCH V3 0/3] tcm_vhost lock and flush fix

2013-03-17 Thread Michael S. Tsirkin
On Fri, Mar 15, 2013 at 09:14:04AM +0800, Asias He wrote: > Hello Nicholas & Michael, > > Could any of you pick this series up? > > Changes in v3 > - Add more comments > > Changes in v2 > - Use vq->private_data insteadof vs->vs_endpoint > - Add label in vhost_scsi_clear_endpoint to simply unloc

Asus P8B75-B and Intel I3-3220T IOMMU

2013-03-17 Thread Matthias Fechner
Dear list, I started with kvm. It is based on a gentoo system with kernel 3.7.10 and qemu 1.2.2-r3 from the gentoo portage. I tried to assign a PCIe card to a guest system. I followed the manual on http://www.linux-kvm.org/page/How_to_assign_devices_with_VT-d_in_KVM And after I rebooted the syst

[PATCH net] vhost/net: fix heads usage of ubuf_info

2013-03-17 Thread Michael S. Tsirkin
ubuf info allocator uses guest controlled head as an index, so a malicious guest could put the same head entry in the ring twice, and we will get two callbacks on the same value. To fix use upend_idx which is guaranteed to be unique. Reported-by: Rusty Russell Signed-off-by: Michael S. Tsirkin C

RE: [PATCH 5/5] KVM: use eoi to track RTC interrupt delivery status

2013-03-17 Thread Zhang, Yang Z
Gleb Natapov wrote on 2013-03-17: > On Fri, Mar 15, 2013 at 04:05:00PM +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: Asus P8B75-B and Intel I3-3220T IOMMU

2013-03-17 Thread Alex Williamson
On Sun, 2013-03-17 at 11:40 +0100, Matthias Fechner wrote: > Dear list, > > I started with kvm. It is based on a gentoo system with kernel 3.7.10 > and qemu 1.2.2-r3 from the gentoo portage. > I tried to assign a PCIe card to a guest system. > > I followed the manual on > http://www.linux-kvm.org

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

2013-03-17 Thread Gleb Natapov
On Sat, Mar 16, 2013 at 11:23:16AM +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. > > VMX and SVM are

Re: [PATCH v2 1/5] KVM: nVMX: Fix injection of PENDING_INTERRUPT and NMI_WINDOW exits to L1

2013-03-17 Thread Gleb Natapov
On Sat, Mar 16, 2013 at 11:23:15AM +0100, Jan Kiszka wrote: > From: Jan Kiszka > > Check if the interrupt or NMI window exit is for L1 by testing if it has > the corresponding controls enabled. This is required when we allow > direct injection from L0 to L2 > > Signed-off-by: Jan Kiszka Reviewe

Re: KVM question regarding use of __direct_map()

2013-03-17 Thread Gleb Natapov
On Sun, Mar 17, 2013 at 02:57:09AM -0400, siddhesh phadke wrote: > Hello, > > KVM uses __direct_map() to setup EPT entries for gfn->pfn mappings. > Is it possible to map gfns of two different guest to same pfn using > this function? > If you do it right it should be possible. Send your code. You

Re: [PATCH 5/5] KVM: use eoi to track RTC interrupt delivery status

2013-03-17 Thread Gleb Natapov
On Sun, Mar 17, 2013 at 01:09:09PM +, Zhang, Yang Z wrote: > >> @@ -241,6 +341,8 @@ static int ioapic_deliver(struct kvm_ioapic *ioapic, > >> int > > irq) > >>irqe.level = 1; > >>irqe.shorthand = 0; > >> + rtc_irq_update(ioapic, &irqe, irq); > >> + > > Do it once when GSI is configure

Re: Asus P8B75-B and Intel I3-3220T IOMMU

2013-03-17 Thread Matthias Fechner
Hi Alex, Am 17.03.2013 14:32, schrieb Alex Williamson: > According to ark the CPU does not support VT-d: > > http://ark.intel.com/products/65694/Intel-Core-i3-3220T-Processor-3M-Cache-2_80-GHz thanks for the link. Could to have reference you can search. If I replace the CPU by a Intel Core i5-3

Re: [PATCH 0/2] Fix booting tcm_vhost + seabios

2013-03-17 Thread Kevin O'Connor
On Fri, Mar 15, 2013 at 09:45:14AM +0800, Asias He wrote: > Asias He (2): > virtio-scsi: Set _DRIVER_OK flag before scsi target scanning > virtio-scsi: Pack struct virtio_scsi_{req_cmd,resp_cmd} Thanks. I pushed these patches. -Kevin -- To unsubscribe from this list: send the line "unsubscri

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

2013-03-17 Thread Jan Kiszka
On 2013-03-17 14:45, Gleb Natapov wrote: > On Sat, Mar 16, 2013 at 11:23:16AM +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 5/5] KVM: MMU: fast invalid all mmio sptes

2013-03-17 Thread Gleb Natapov
On Fri, Mar 15, 2013 at 11:29:53PM +0800, Xiao Guangrong wrote: > This patch tries to introduce a very simple and scale way to invalid all > mmio sptes - it need not walk any shadow pages and hold mmu-lock > > KVM maintains a global mmio invalid generation-number which is stored in > kvm->arch.mmi

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

2013-03-17 Thread Gleb Natapov
On Sun, Mar 17, 2013 at 04:02:07PM +0100, Jan Kiszka wrote: > On 2013-03-17 14:45, Gleb Natapov wrote: > > On Sat, Mar 16, 2013 at 11:23:16AM +0100, Jan Kiszka wrote: > >> From: Jan Kiszka > >> > >> The basic idea is to always transfer the pending event injection on > >> vmexit into the architectu

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

2013-03-17 Thread Jan Kiszka
On 2013-03-17 16:14, Gleb Natapov wrote: > On Sun, Mar 17, 2013 at 04:02:07PM +0100, Jan Kiszka wrote: >> On 2013-03-17 14:45, Gleb Natapov wrote: >>> On Sat, Mar 16, 2013 at 11:23:16AM +0100, Jan Kiszka wrote: From: Jan Kiszka The basic idea is to always transfer the pending event

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

2013-03-17 Thread Gleb Natapov
On Sun, Mar 17, 2013 at 04:17:19PM +0100, Jan Kiszka wrote: > On 2013-03-17 16:14, Gleb Natapov wrote: > > On Sun, Mar 17, 2013 at 04:02:07PM +0100, Jan Kiszka wrote: > >> On 2013-03-17 14:45, Gleb Natapov wrote: > >>> On Sat, Mar 16, 2013 at 11:23:16AM +0100, Jan Kiszka wrote: > From: Jan Kis

Re: [PATCH kvm-unit-tests 5/5] x86-run: Pull extra arguments from unittests.cfg

2013-03-17 Thread Gleb Natapov
On Fri, Mar 15, 2013 at 08:09:09PM -0400, Cole Robinson wrote: > Some tests want extra arguments as enumerated in unittests.cfg, > use them. > > unittests.cfg also has a few sections about invoking certains tests > with different combinations of options, but x86-run doesn't do > anything with that

Re: [PATCH net] vhost/net: fix heads usage of ubuf_info

2013-03-17 Thread David Miller
From: "Michael S. Tsirkin" Date: Sun, 17 Mar 2013 14:46:09 +0200 > ubuf info allocator uses guest controlled head as an index, > so a malicious guest could put the same head entry in the ring twice, > and we will get two callbacks on the same value. > To fix use upend_idx which is guaranteed to b

Re: [PATCH net] vhost/net: fix heads usage of ubuf_info

2013-03-17 Thread Michael S. Tsirkin
On Sun, Mar 17, 2013 at 02:29:55PM -0400, David Miller wrote: > From: "Michael S. Tsirkin" > Date: Sun, 17 Mar 2013 14:46:09 +0200 > > > ubuf info allocator uses guest controlled head as an index, > > so a malicious guest could put the same head entry in the ring twice, > > and we will get two ca

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

2013-03-17 Thread Paul Mackerras
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: Lai Jiangshan > Cc: Marcelo Tosatti > Cc: Gleb Natapov > Cc: Alexander Graf

Re: [PATCH kvm-unit-tests 5/5] x86-run: Pull extra arguments from unittests.cfg

2013-03-17 Thread Cole Robinson
On 03/17/2013 11:25 AM, Gleb Natapov wrote: > On Fri, Mar 15, 2013 at 08:09:09PM -0400, Cole Robinson wrote: >> Some tests want extra arguments as enumerated in unittests.cfg, >> use them. >> >> unittests.cfg also has a few sections about invoking certains tests >> with different combinations of op

RE: [PATCH v6 0/5] KVM: VMX: Add Posted Interrupt supporting

2013-03-17 Thread Zhang, Yang Z
Zhang, Yang Z wrote on 2013-03-15: > 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 subsequ