Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexander Graf
On 22.05.2012, at 08:11, Alexey Kardashevskiy wrote: > On 22/05/12 15:52, Alexander Graf wrote: >> >> >> On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: >> >>> On 22/05/12 13:21, Alexander Graf wrote: On 22.05.2012, at 04:02, Benjamin Herrenschmidt wrote:

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexander Graf
On 22.05.2012, at 08:11, Alexey Kardashevskiy wrote: > On 22/05/12 15:52, Alexander Graf wrote: >> >> >> On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: >> >>> On 22/05/12 13:21, Alexander Graf wrote: On 22.05.2012, at 04:02, Benjamin Herrenschmidt wrote:

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexey Kardashevskiy
On 22/05/12 15:52, Alexander Graf wrote: > > > On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: > >> On 22/05/12 13:21, Alexander Graf wrote: >>> >>> >>> On 22.05.2012, at 04:02, Benjamin Herrenschmidt >>> wrote: >>> On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote:

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexander Graf
On 22.05.2012, at 05:44, Alexey Kardashevskiy wrote: > On 22/05/12 13:21, Alexander Graf wrote: >> >> >> On 22.05.2012, at 04:02, Benjamin Herrenschmidt >> wrote: >> >>> On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote: Alexander, Is that any better? :) >>> >>

Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-21 Thread Gleb Natapov
On Mon, May 21, 2012 at 04:30:41PM -0300, Marcelo Tosatti wrote: > On Mon, May 21, 2012 at 04:15:50PM +0800, Xiao Guangrong wrote: > > On 05/21/2012 04:08 PM, Gleb Natapov wrote: > > > > > On Mon, May 21, 2012 at 02:45:45PM +0800, Xiao Guangrong wrote: > > >> If we map a readonly memory space from

[PATCH v2 05/13] pci: Add ACS validation utility

2012-05-21 Thread Alex Williamson
In a PCI environment, transactions aren't always required to reach the root bus before being re-routed. Intermediate switches between an endpoint and the root bus can redirect DMA back downstream before things like IOMMUs have a chance to intervene. Legacy PCI is always susceptible to this as it

[PATCH v2 06/13] iommu: Make use of DMA quirking and ACS enabled check for groups

2012-05-21 Thread Alex Williamson
Incorporate DMA quirking and ACS checking into amd_iommu and intel-iommu. Note that IOMMU groups are not yet used for streaming DMA, so this doesn't immediately solve the problems with broken Ricoh devices. This a very strict implementation of ACS checking, which will often result in multifunctio

[PATCH v2 03/13] iommu: IOMMU groups for VT-d and AMD-Vi

2012-05-21 Thread Alex Williamson
Add back group support for AMD & Intel. amd_iommu already tracks devices and has init and uninit routines to manage groups. intel-iommu does this on the fly, so we make use of the notifier support built into iommu groups to create and remove groups. Signed-off-by: Alex Williamson --- drivers/i

[PATCH v2 02/13] iommu: IOMMU Groups

2012-05-21 Thread Alex Williamson
IOMMU device groups are currently a rather vague associative notion with assembly required by the user or user level driver provider to do anything useful. This patch intends to grow the IOMMU group concept into something a bit more consumable. To do this, we first create an object representing t

[PATCH v2 00/13] IOMMU Groups + VFIO

2012-05-21 Thread Alex Williamson
found here on top of 3.4: git://github.com/awilliam/linux-vfio.git iommu-group-vfio-20120521 The Qemu tree has also been updated to Qemu 1.1 and can be found here: git://github.com/awilliam/qemu-vfio.git iommu-group-vfio I'd really like to make a push to get this in for 3.5, so let's talk

[PATCH v2 01/13] driver core: Add iommu_group tracking to struct device

2012-05-21 Thread Alex Williamson
IOMMU groups allow IOMMU drivers to represent DMA visibility and isolation of devices. Multiple devices may be grouped together for the purposes of DMA. Placing a pointer on struct device enable easy access for things like streaming DMA programming and drivers like VFIO. Signed-off-by: Alex Will

[PATCH v2 08/13] vfio: Add documentation

2012-05-21 Thread Alex Williamson
Signed-off-by: Alex Williamson --- Documentation/vfio.txt | 315 1 files changed, 315 insertions(+), 0 deletions(-) create mode 100644 Documentation/vfio.txt diff --git a/Documentation/vfio.txt b/Documentation/vfio.txt new file mode 100644 inde

[PATCH v2 09/13] vfio: x86 IOMMU implementation

2012-05-21 Thread Alex Williamson
x86 is probably the wrong name for this VFIO IOMMU driver, but x86 is the primary target for it. This driver support a very simple usage model using the existing IOMMU API. The IOMMU is expected to support the full host address space with no special IOVA windows, number of mappings restrictions,

[PATCH v2 10/13] pci: export pci_user functions for use by other drivers

2012-05-21 Thread Alex Williamson
VFIO PCI support will make use of these for user initiated PCI config accesses. Signed-off-by: Alex Williamson Acked-by: Bjorn Helgaas --- drivers/pci/access.c |6 -- drivers/pci/pci.h|7 --- include/linux/pci.h |8 3 files changed, 12 insertions(+), 9 deletio

[PATCH v2 12/13] pci: Misc pci_reg additions

2012-05-21 Thread Alex Williamson
Fill in many missing definitions and add sizeof fields for many sections allowing for more extensive config parsing. Signed-off-by: Alex Williamson --- include/linux/pci_regs.h | 112 +- 1 files changed, 100 insertions(+), 12 deletions(-) diff --git

[PATCH v2 11/13] pci: Create common pcibios_err_to_errno

2012-05-21 Thread Alex Williamson
For returning errors out to non-PCI code. Re-name xen's version. Signed-off-by: Alex Williamson Acked-by: Konrad Rzeszutek Wilk --- drivers/xen/xen-pciback/conf_space.c |6 +++--- include/linux/pci.h | 26 ++ 2 files changed, 29 insertions(+), 3

[PATCH v2 07/13] vfio: VFIO core

2012-05-21 Thread Alex Williamson
VFIO is a secure user level driver for use with both virtual machines and user level drivers. VFIO makes use of IOMMU groups to ensure the isolation of devices in use, allowing unprivileged user access. It's intended that VFIO will replace KVM device assignment and UIO drivers (in cases where the

[PATCH v2 04/13] pci: Add PCI DMA source ID quirk

2012-05-21 Thread Alex Williamson
DMA transactions are tagged with the source ID of the device making the request. Occasionally hardware screws this up and uses the source ID of a different device (often the wrong function number of a multifunction device). A specific Ricoh multifunction device is a prime example of this problem

Re: [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump

2012-05-21 Thread Yanfei Zhang
于 2012年05月21日 17:36, Avi Kivity 写道: > On 05/21/2012 12:08 PM, Yanfei Zhang wrote: >> 于 2012年05月21日 16:34, Avi Kivity 写道: >>> On 05/21/2012 05:32 AM, Yanfei Zhang wrote: 于 2012年05月21日 01:43, Avi Kivity 写道: > On 05/16/2012 10:50 AM, zhangyanfei wrote: >> This patch set exports offsets of

Re: [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump

2012-05-21 Thread Yanfei Zhang
于 2012年05月22日 02:58, Eric Northup 写道: > On Wed, May 16, 2012 at 12:50 AM, zhangyanfei > wrote: >> >> This patch set exports offsets of VMCS fields as note information for >> kdump. We call it VMCSINFO. The purpose of VMCSINFO is to retrieve >> runtime state of guest machine image, such as register

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexey Kardashevskiy
On 22/05/12 13:21, Alexander Graf wrote: > > > On 22.05.2012, at 04:02, Benjamin Herrenschmidt > wrote: > >> On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote: >>> Alexander, >>> >>> Is that any better? :) >> >> Alex (Graf that is), ping ? >> >> The original patch from Alexey was f

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Alexander Graf
On 22.05.2012, at 04:02, Benjamin Herrenschmidt wrote: > On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote: >> Alexander, >> >> Is that any better? :) > > Alex (Graf that is), ping ? > > The original patch from Alexey was fine btw. > > VFIO will always call things with the exis

[PATCH v3 4/4] Enabling Access bit when doing memory swapping

2012-05-21 Thread Xudong Hao
Enabling Access bit when doing memory swapping. Changes from v2: -Still using claer_bit() function to make sure it's atomic operation. Signed-off-by: Haitao Shan Signed-off-by: Xudong Hao --- arch/x86/kvm/mmu.c | 14 -- arch/x86/kvm/vmx.c |6 -- 2 files changed, 12 inse

[PATCH v3 4/4] Enabling Access bit when doing memory swapping

2012-05-21 Thread Xudong Hao
Enabling Access bit when doing memory swapping. Signed-off-by: Haitao Shan Signed-off-by: Xudong Hao --- arch/x86/kvm/mmu.c | 14 -- arch/x86/kvm/vmx.c |6 -- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index 7210

Re: [PATCH 0/7] KVM fixes for 3.2.17

2012-05-21 Thread Ben Hutchings
On Fri, 2012-05-18 at 17:58 -0300, Marcelo Tosatti wrote: > See individual patches for details. [...] These came a little too late for 3.2.18, but I've queued them up now. Ben. -- Ben Hutchings You can't have everything. Where would you put it? signature.asc Description: This is a digitally

Re: [RFC PATCH] qemu pci: pci_add_capability enhancement to prevent damaging config space

2012-05-21 Thread Benjamin Herrenschmidt
On Fri, 2012-05-18 at 15:12 +1000, Alexey Kardashevskiy wrote: > Alexander, > > Is that any better? :) Alex (Graf that is), ping ? The original patch from Alexey was fine btw. VFIO will always call things with the existing capability offset so there's no real risk of doing the wrong thing or br

RE: [PATCH v3] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-21 Thread Mao, Junjie
> > > @@ > > > > -1711,6 +1717,22 @@ static bool vmx_rdtscp_supported(void) > > > > return cpu_has_vmx_rdtscp(); > > > > } > > > > > > > > +static bool vmx_pcid_supported(void) { > > > > + /* > > > > +* This function is only for determining whether to expose PCID > > > > bit

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Thomas Gleixner
On Tue, 22 May 2012, Michael S. Tsirkin wrote: > On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: > > On Mon, 21 May 2012, Michael S. Tsirkin wrote: > > > +static u8 count_vectors(void *bitmap) > > > +{ > > > + u32 *word = bitmap; > > > + int word_offset; > > > + u8 count = 0; > > >

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread H. Peter Anvin
On 05/21/2012 04:06 PM, Michael S. Tsirkin wrote: > > I think the reason is __apic_read which now simply copies the registers > out to guest, this code will become less straight-forward if it's not > 1:1. > It can still be 1:1, just drop the 12 bytes of completely useless padding after each 32-b

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Thomas Gleixner
On Tue, 22 May 2012, Michael S. Tsirkin wrote: > On Tue, May 22, 2012 at 12:14:18AM +0200, Thomas Gleixner wrote: > > On Tue, 22 May 2012, Michael S. Tsirkin wrote: > > > > > On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: > > > > > @@ -242,6 +262,25 @@ static inline void apic_cle

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: > On Mon, 21 May 2012, Michael S. Tsirkin wrote: > > > We perform ISR lookups twice: during interrupt > > injection and on EOI. Typical workloads only have > > a single bit set there. So we can avoid ISR scans by > > 1. counting bits

[ANNOUNCE] kvm-kmod-3.4

2012-05-21 Thread Jan Kiszka
After the release of kernel 3.4, this is now the announcements of the corresponding kvm-kmod-3.4. The package is available from http://sourceforge.net/projects/kvm/files/kvm-kmod/3.4/kvm-kmod-3.4.tar.bz2/download See [1] for further details on kvm-kmod. Major KVM changes since kvm-kmod-3.3.6: -

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Thomas Gleixner
On Tue, 22 May 2012, Michael S. Tsirkin wrote: > On Tue, May 22, 2012 at 12:14:18AM +0200, Thomas Gleixner wrote: > > On Tue, 22 May 2012, Michael S. Tsirkin wrote: > > > > > On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: > > > > > @@ -242,6 +262,25 @@ static inline void apic_cle

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2012 at 12:44:39AM +0200, Thomas Gleixner wrote: > Michael, > > On Tue, 22 May 2012, Michael S. Tsirkin wrote: > > On Tue, May 22, 2012 at 12:14:18AM +0200, Thomas Gleixner wrote: > > > On Tue, 22 May 2012, Michael S. Tsirkin wrote: > > > > > > > On Mon, May 21, 2012 at 11:04:25PM

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Thomas Gleixner
Michael, On Tue, 22 May 2012, Michael S. Tsirkin wrote: > On Tue, May 22, 2012 at 12:14:18AM +0200, Thomas Gleixner wrote: > > On Tue, 22 May 2012, Michael S. Tsirkin wrote: > > > > > On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: > > > > > @@ -242,6 +262,25 @@ static inline voi

Re: [PATCH v3] KVM: x86: Implement PCID/INVPCID for guests with EPT

2012-05-21 Thread Marcelo Tosatti
On Mon, May 21, 2012 at 12:40:42AM +, Mao, Junjie wrote: > > -Original Message- > > From: Marcelo Tosatti [mailto:mtosa...@redhat.com] > > Sent: Saturday, May 19, 2012 5:51 AM > > To: Mao, Junjie > > Cc: n...@math.technion.ac.il; 'kvm@vger.kernel.org' > > Subject: Re: [PATCH v3] KVM: x8

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Michael S. Tsirkin
On Tue, May 22, 2012 at 12:14:18AM +0200, Thomas Gleixner wrote: > On Tue, 22 May 2012, Michael S. Tsirkin wrote: > > > On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: > > > > @@ -242,6 +262,25 @@ static inline void apic_clear_irr(int vec, struct > > > > kvm_lapic *apic) > > > >

Re: gettimeofday() vsyscall for kvm-clock?

2012-05-21 Thread Andrew Theurer
On 05/21/2012 03:36 PM, Marcelo Tosatti wrote: On Mon, May 21, 2012 at 03:26:54PM -0500, Andrew Theurer wrote: Wondering if a user-space gettimofday() for kvm-clock has been considered before. I am seeing a pretty large difference in performance between tsc and kvm-clock. I have to assume at l

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Thomas Gleixner
On Tue, 22 May 2012, Michael S. Tsirkin wrote: > On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: > > > @@ -242,6 +262,25 @@ static inline void apic_clear_irr(int vec, struct > > > kvm_lapic *apic) > > > apic->irr_pending = true; > > > } > > > > > > +static inline voi

Re: [PATCH] spapr: Add "memop" hypercall

2012-05-21 Thread Benjamin Herrenschmidt
On Mon, 2012-05-21 at 16:55 +0300, Avi Kivity wrote: > > Okay. But let's have a spec, even a kvm-private one, and then an > implementation of that spec, instead of an implementation and some > documentation added as an afterthought (or not). > > > It's a bit like if you had private calls between

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2012 at 11:04:25PM +0200, Thomas Gleixner wrote: > > @@ -242,6 +262,25 @@ static inline void apic_clear_irr(int vec, struct > > kvm_lapic *apic) > > apic->irr_pending = true; > > } > > > > +static inline void apic_set_isr(int vec, struct kvm_lapic *apic) > > +{ > > +

Re: [PATCH v2 3/5] KVM: Flush TLB in mmu notifier without holding mmu_lock

2012-05-21 Thread Marcelo Tosatti
On Mon, May 21, 2012 at 05:58:50PM -0300, Marcelo Tosatti wrote: > On Thu, May 17, 2012 at 01:24:42PM +0300, Avi Kivity wrote: > > Signed-off-by: Avi Kivity > > --- > > virt/kvm/kvm_main.c | 16 > > 1 file changed, 8 insertions(+), 8 deletions(-) > > > > diff --git a/virt/kvm/

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Thomas Gleixner
On Mon, 21 May 2012, Michael S. Tsirkin wrote: > We perform ISR lookups twice: during interrupt > injection and on EOI. Typical workloads only have > a single bit set there. So we can avoid ISR scans by > 1. counting bits as we set/clear them in ISR > 2. if count is 1, caching the vector number >

Re: [PATCH v2 3/5] KVM: Flush TLB in mmu notifier without holding mmu_lock

2012-05-21 Thread Marcelo Tosatti
On Thu, May 17, 2012 at 01:24:42PM +0300, Avi Kivity wrote: > Signed-off-by: Avi Kivity > --- > virt/kvm/kvm_main.c | 16 > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 585ab45..9f6d15d 100644 > --- a/virt/k

Re: [RFC PATCH 5/5] virtio-blk: Use block layer provided spinlock

2012-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2012 at 05:08:33PM +0800, Asias He wrote: > Block layer will allocate a spinlock for the queue if the driver does > not provide one in blk_init_queue(). > > The reason to use the internal spinlock is that blk_cleanup_queue() will > switch to use the internal spinlock in the cleanup

Re: [PATCHv2] Introduce bitmask for apic attention reasons.

2012-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2012 at 10:50:30PM +0300, Michael S. Tsirkin wrote: > On Thu, Apr 19, 2012 at 02:06:29PM +0300, Gleb Natapov wrote: > > The patch introduces a bitmap that will hold reasons apic should be > > checked during vmexit. This is in a preparation for vp eoi patch > > that will add one more

Re: gettimeofday() vsyscall for kvm-clock?

2012-05-21 Thread Marcelo Tosatti
On Mon, May 21, 2012 at 03:26:54PM -0500, Andrew Theurer wrote: > Wondering if a user-space gettimofday() for kvm-clock has been > considered before. I am seeing a pretty large difference in > performance between tsc and kvm-clock. I have to assume at least > some of this is due to the mode switc

gettimeofday() vsyscall for kvm-clock?

2012-05-21 Thread Andrew Theurer
Wondering if a user-space gettimofday() for kvm-clock has been considered before. I am seeing a pretty large difference in performance between tsc and kvm-clock. I have to assume at least some of this is due to the mode switch for kvm-clock. Here are the results: (this is a 16 vCPU VM on a

Re: [PATCH v2 2/5] KVM: MMU: Convert remote flushes to kvm_mark_tlb_dirty() and a conditional flush

2012-05-21 Thread Marcelo Tosatti
On Thu, May 17, 2012 at 01:24:41PM +0300, Avi Kivity wrote: > This allows us to later move the actual flush out of protection of the > mmu spinlock, provided there are no additional dependencies. > > Constructs of the form > > if (pred) > kvm_flush_remote_tlbs(kvm) > > are converted

Re: [PATCHv2] Introduce bitmask for apic attention reasons.

2012-05-21 Thread Michael S. Tsirkin
On Thu, Apr 19, 2012 at 02:06:29PM +0300, Gleb Natapov wrote: > The patch introduces a bitmap that will hold reasons apic should be > checked during vmexit. This is in a preparation for vp eoi patch > that will add one more check on vmexit. With the bitmap we can do > if(apic_attention) to check ev

Re: [PATCH] KVM: fix async page fault working for readonly mapping

2012-05-21 Thread Marcelo Tosatti
On Mon, May 21, 2012 at 04:15:50PM +0800, Xiao Guangrong wrote: > On 05/21/2012 04:08 PM, Gleb Natapov wrote: > > > On Mon, May 21, 2012 at 02:45:45PM +0800, Xiao Guangrong wrote: > >> If we map a readonly memory space from host to guest and the page is > >> not currently mapped in the host, we wi

Re: [PATCH v2 0/5] Export offsets of VMCS fields as note information for kdump

2012-05-21 Thread Eric Northup
On Wed, May 16, 2012 at 12:50 AM, zhangyanfei wrote: > > This patch set exports offsets of VMCS fields as note information for > kdump. We call it VMCSINFO. The purpose of VMCSINFO is to retrieve > runtime state of guest machine image, such as registers, in host > machine's crash dump as VMCS form

[Autotest][PATCH 7/7] kvm-tests: Adds tests for measure migration speed.

2012-05-21 Thread Jiří Župka
tests: 1) Single host measure migration speed. 2) Multi host measure migration speed. description: 1) start mem stresser in VM to avoid end of migraiton 2) get statistic of migraiton speed 3) kill VMs 4) if migration speed is slower than desired migration speed it raise warning Signed

[Autotest][PATCH 4/7] virt,kvm: Adds possibility interrupt migration function.

2012-05-21 Thread Jiří Župka
It starts migration and after start of migration it returns control to calling function. Signed-off-by: Jiří Župka --- client/virt/kvm_vm.py | 16 +++- 1 files changed, 11 insertions(+), 5 deletions(-) diff --git a/client/virt/kvm_vm.py b/client/virt/kvm_vm.py index 19d016f..62d9c

[Autotest][PATCH 3/7] virt.kvm: Unifying qmp/human monitor set_migration_speed

2012-05-21 Thread Jiří Župka
Signed-off-by: Jiří Župka --- client/virt/kvm_monitor.py |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/client/virt/kvm_monitor.py b/client/virt/kvm_monitor.py index a49fd18..f7a3e34 100644 --- a/client/virt/kvm_monitor.py +++ b/client/virt/kvm_monitor.py @@ -966,6 +966,

[Autotest][PATCH 2/7] shared: Adds class for collecting a simple statistics.

2012-05-21 Thread Jiří Župka
Signed-off-by: Jiří Župka --- client/shared/base_utils.py | 34 ++ client/shared/base_utils_unittest.py | 19 +++ 2 files changed, 53 insertions(+), 0 deletions(-) diff --git a/client/shared/base_utils.py b/client/shared/base_utils.py

[Autotest][PATCH 1/7] virt: Add memory stress test to cpu_flags test.

2012-05-21 Thread Jiří Župka
usage: ./cpuflags-test --stressmem 100 (in MB) Signed-off-by: Jiří Župka --- client/virt/deps/test_cpu_flags/Makefile|9 +- client/virt/deps/test_cpu_flags/cpuflags-test.c | 28 --- client/virt/deps/test_cpu_flags/stressmem.c | 33 +++

Re: [PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Michael S. Tsirkin
On Mon, May 21, 2012 at 07:37:27PM +0300, Michael S. Tsirkin wrote: > We perform ISR lookups twice: during interrupt > injection and on EOI. Typical workloads only have > a single bit set there. So we can avoid ISR scans by > 1. counting bits as we set/clear them in ISR > 2. if count is 1, caching

Re: [PATCH 05/13] pci: New pci_acs_enabled()

2012-05-21 Thread Don Dutile
On 05/21/2012 10:59 AM, Alex Williamson wrote: On Mon, 2012-05-21 at 09:31 -0400, Don Dutile wrote: On 05/18/2012 10:47 PM, Alex Williamson wrote: On Fri, 2012-05-18 at 19:00 -0400, Don Dutile wrote: On 05/18/2012 06:02 PM, Alex Williamson wrote: On Wed, 2012-05-16 at 09:29 -0400, Don Dutile

[PATCH 08/19] kvm: Enable in-kernel irqchip support by default

2012-05-21 Thread Avi Kivity
From: Jan Kiszka As MSI is now fully supported by KVM (/wrt available features in upstream), we can finally enable the in-kernel irqchip by default. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- kvm-all.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kv

[PATCH 17/19] kvm: Enable use of kvm_irqchip_in_kernel in hwlib code

2012-05-21 Thread Avi Kivity
From: Jan Kiszka Provide a dummy kvm_kernel_irqchip so that kvm_irqchip_in_kernel can be used by code that is not under CONFIG_KVM protection. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- kvm-stub.c |1 + 1 file changed, 1 insertion(+) diff --git a/kvm-stub.c b/kvm-stub.c inde

[PATCH 09/19] msix: Factor out msix_get_message

2012-05-21 Thread Avi Kivity
From: Jan Kiszka This helper will also be used by the upcoming config notifier. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- hw/msix.c | 19 +-- 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/hw/msix.c b/hw/msix.c index 3835eaa..3197465 100644 ---

[PATCH 05/19] kvm: x86: Wire up MSI support for in-kernel irqchip

2012-05-21 Thread Avi Kivity
From: Jan Kiszka Catch writes to the MSI MMIO region in the KVM APIC and forward them to the kernel. Provide the kernel support GSI routing, this allows to enable MSI support also for in-kernel irqchip mode. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- hw/kvm/apic.c | 34 +++

[PATCH 06/19] kvm: Update kernel headers

2012-05-21 Thread Avi Kivity
From: Jan Kiszka Corresponding kvm.git hash: f2569053e0 Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- linux-headers/linux/kvm.h | 38 ++ 1 file changed, 38 insertions(+) diff --git a/linux-headers/linux/kvm.h b/linux-headers/linux/kvm.h in

[PATCH 04/19] pc: Enable MSI support at APIC level

2012-05-21 Thread Avi Kivity
From: Jan Kiszka Push msi_supported enabling to the APIC implementations where we can encapsulate the decision more cleanly, hiding the details from the generic code. Acked-by: Stefano Stabellini Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- hw/apic.c |3 +++ hw/pc.c

[PATCH 07/19] kvm: Add support for direct MSI injections

2012-05-21 Thread Avi Kivity
From: Jan Kiszka If the kernel supports KVM_SIGNAL_MSI, we can avoid the route-based MSI injection mechanism. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- kvm-all.c | 22 +++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/kvm-all.c b/kvm-al

[PATCH 13/19] kvm: Introduce kvm_irqchip_add_msi_route

2012-05-21 Thread Avi Kivity
From: Jan Kiszka Add a service that establishes a static route from a virtual IRQ line to an MSI message. Will be used for IRQFD and device assignment. As we will use this service outside of CONFIG_KVM protected code, stub it properly. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- k

[PATCH 16/19] kvm: Introduce kvm_irqchip_add/remove_irqfd

2012-05-21 Thread Avi Kivity
From: Jan Kiszka Add services to associate an eventfd file descriptor as input with an IRQ line as output. Such a line can be an input pin of an in-kernel irqchip or a virtual line returned by kvm_irqchip_add_route. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- kvm-all.c | 30 +++

[PATCH 03/19] kvm: Introduce basic MSI support for in-kernel irqchips

2012-05-21 Thread Avi Kivity
From: Jan Kiszka This patch basically adds kvm_irqchip_send_msi, a service for sending arbitrary MSI messages to KVM's in-kernel irqchip models. As the original KVM API requires us to establish a static route from a pseudo GSI to the target MSI message and inject the MSI via toggling that virtua

[PATCH 12/19] kvm: Rename kvm_irqchip_add_route to kvm_irqchip_add_irq_route

2012-05-21 Thread Avi Kivity
From: Jan Kiszka We will add kvm_irqchip_add_msi_route, so let's make the difference clearer. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- hw/pc_piix.c |8 kvm-all.c|2 +- kvm.h|2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/hw

[PATCH 15/19] kvm: Make kvm_irqchip_commit_routes an internal service

2012-05-21 Thread Avi Kivity
From: Jan Kiszka Automatically commit route changes after kvm_add_routing_entry and kvm_irqchip_release_virq. There is no performance relevant use case for which collecting multiple route changes is beneficial. This makes kvm_irqchip_commit_routes an internal service which assert()s that the corr

[PATCH 11/19] msix: Introduce vector notifiers

2012-05-21 Thread Avi Kivity
From: Jan Kiszka Vector notifiers shall be triggered by the MSI/MSI-X core whenever a relevant configuration change is programmed by the guest. In case of MSI-X, changes are reported when the effective mask (global && per-vector) alters its state. On unmask, the current vector configuration is in

[PATCH 19/19] virtio/vhost: Add support for KVM in-kernel MSI injection

2012-05-21 Thread Avi Kivity
From: Jan Kiszka Make use of the new vector notifier to track changes of the MSI-X configuration of virtio PCI devices. On enabling events, we establish the required virtual IRQ to MSI-X message route and link the signaling eventfd file descriptor to this vIRQ line. That way, vhost-generated inte

[PULL 00/20 1.2] kvm updates

2012-05-21 Thread Avi Kivity
Please pull from: git://git.kernel.org/pub/scm/virt/kvm/qemu-kvm.git uq/master This is mostly Jan's MSI for KVM patches. Avi Kivity (1): kvm: update vmxcap for EPT A/D, INVPCID, RDRAND, VMFUNC Jan Kiszka (19): kvm: R

[PATCH 10/19] msix: Invoke msix_handle_mask_update on msix_mask_all

2012-05-21 Thread Avi Kivity
From: Jan Kiszka In preparation of firing vector notifiers on mask changes, call msix_handle_mask_update also from msix_mask_all. So far, this will have no real effect. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- hw/msix.c |4 1 file changed, 4 insertions(+) diff --git a

[PATCH 01/19] kvm: Refactor KVMState::max_gsi to gsi_count

2012-05-21 Thread Avi Kivity
From: Jan Kiszka Instead of the bitmap size, store the maximum of GSIs the kernel support. Move the GSI limit assertion to the API function kvm_irqchip_add_route and make it stricter. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- kvm-all.c |8 1 file changed, 4 ins

[PATCH 14/19] kvm: Publicize kvm_irqchip_release_virq

2012-05-21 Thread Avi Kivity
From: Jan Kiszka This allows to drop routes created by kvm_irqchip_add_irq/msi_route again. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- kvm-all.c |2 +- kvm-stub.c |4 kvm.h |1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/kvm-all.c b/kvm-

[PATCH 02/19] Introduce MSIMessage structure

2012-05-21 Thread Avi Kivity
From: Jan Kiszka Will be used for generating and distributing MSI messages, both in emulation mode and under KVM. Signed-off-by: Jan Kiszka Signed-off-by: Marcelo Tosatti --- hw/msi.h |5 + qemu-common.h |1 + 2 files changed, 6 insertions(+) diff --git a/hw/msi.h b/hw/msi.h

[PATCH 18/19] msix: Add msix_nr_vectors_allocated

2012-05-21 Thread Avi Kivity
From: Jan Kiszka Analogously to msi_nr_vectors_allocated, add a service for MSI-X. Will be used by the virtio-pci layer. Signed-off-by: Jan Kiszka Signed-off-by: Avi Kivity --- hw/msix.c |5 + hw/msix.h |2 ++ 2 files changed, 7 insertions(+) diff --git a/hw/msix.c b/hw/msix.c in

Re: [PATCH 11/13] pci: Create common pcibios_err_to_errno

2012-05-21 Thread Konrad Rzeszutek Wilk
On Fri, May 11, 2012 at 04:56:44PM -0600, Alex Williamson wrote: > For returning errors out to non-PCI code. Re-name xen's version. > > Signed-off-by: Alex Williamson Acked-by: Konrad Rzeszutek Wilk > --- > > drivers/xen/xen-pciback/conf_space.c |6 +++--- > include/linux/pci.h

[PATCH] kvm: optimize ISR lookups

2012-05-21 Thread Michael S. Tsirkin
We perform ISR lookups twice: during interrupt injection and on EOI. Typical workloads only have a single bit set there. So we can avoid ISR scans by 1. counting bits as we set/clear them in ISR 2. if count is 1, caching the vector number 3. if count != 1, invalidating the cache The real purpose o

Re: [RFC PATCH 1/5] block: Introduce q->abort_queue_fn()

2012-05-21 Thread Tejun Heo
On Mon, May 21, 2012 at 05:08:29PM +0800, Asias He wrote: > When user hot-unplug a disk which is busy serving I/O, __blk_run_queue > might be unable to drain all the requests. As a result, the > blk_drain_queue() would loop forever and blk_cleanup_queue would not > return. So hot-unplug will fail.

Re: Biweekly KVM Test report, kernel 51bfd299... qemu a1fce560...

2012-05-21 Thread Kevin Wolf
Am 21.05.2012 11:45, schrieb Ren, Yongjie: >> -Original Message- >> From: Kevin Wolf [mailto:kw...@redhat.com] >> Sent: Monday, May 21, 2012 5:05 PM >> To: Avi Kivity >> Cc: Ren, Yongjie; kvm@vger.kernel.org >> Subject: Re: Biweekly KVM Test report, kernel 51bfd299... qemu >> a1fce560... >>

KVM call agenda for May, Tuesday 22

2012-05-21 Thread Juan Quintela
Hi Please send in any agenda items you are interested in covering. Thanks, Juan. -- 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://vger.kernel.org/majordomo-info.html

Re: [PATCH 05/13] pci: New pci_acs_enabled()

2012-05-21 Thread Alex Williamson
On Mon, 2012-05-21 at 09:31 -0400, Don Dutile wrote: > On 05/18/2012 10:47 PM, Alex Williamson wrote: > > On Fri, 2012-05-18 at 19:00 -0400, Don Dutile wrote: > >> On 05/18/2012 06:02 PM, Alex Williamson wrote: > >>> On Wed, 2012-05-16 at 09:29 -0400, Don Dutile wrote: > On 05/15/2012 05:09 PM

Re: [PATCH] kvm: make asm-generic/kvm_para.h have an ifdef __KERNEL__ block

2012-05-21 Thread Avi Kivity
On 05/18/2012 08:59 PM, Paul Gortmaker wrote: > There are two functions in this asm-generic file. Looking at > other arch which do not use the generic version, these two fcns > are within an #ifdef __KERNEL__ block, so make the generic one > consistent with those. Thanks, applied for 3.5. -- er

Re: [PATCH 1/4] KVM: Add APIs for unlocked TLB flush

2012-05-21 Thread Avi Kivity
On 05/10/2012 12:03 AM, Marcelo Tosatti wrote: > > > > > It has the advantage that it requires code to explicitly document where > > > the TLB must be flushed and the sites which expect sptes to be in sync > > > with TLBs. > > > > I'm looking for an idea of how to make the flush in those cases no

[QEMU 1.1 PATCH v3] Expose CPUID leaf 7 only for -cpu host

2012-05-21 Thread Eduardo Habkost
Changes v2 -> v3; - Check for kvm_enabled() before setting cpuid_7_0_ebx_features Changes v1 -> v2: - Use kvm_arch_get_supported_cpuid() instead of host_cpuid() on cpu_x86_fill_host(). We should use GET_SUPPORTED_CPUID for all bits on "-cpu host" eventually, but I am not changing all

Re: [Qemu-devel] [QEMU 1.1 PATCH v2] Expose CPUID leaf 7 only for -cpu host

2012-05-21 Thread Eduardo Habkost
On Thu, May 17, 2012 at 01:26:55PM -0300, Eduardo Habkost wrote: [...] > @@ -521,6 +523,12 @@ static int cpu_x86_fill_host(x86_def_t *x86_cpu_def) > x86_cpu_def->ext_features = ecx; > x86_cpu_def->features = edx; > > +if (x86_cpu_def->level >= 7) { > +x86_cpu_def->cpuid_7_0_

Re: [PATCH] spapr: Add "memop" hypercall

2012-05-21 Thread Avi Kivity
On 05/21/2012 02:48 PM, Benjamin Herrenschmidt wrote: > On Mon, 2012-05-21 at 13:07 +0300, Avi Kivity wrote: > > > Now I'm adding another one, so yes, it's looking like a trend :-) I'll > > > look into it, at this stage with only those two, adding some comments in > > > the header might be plenty e

Re: [PATCH 05/13] pci: New pci_acs_enabled()

2012-05-21 Thread Don Dutile
On 05/18/2012 10:47 PM, Alex Williamson wrote: On Fri, 2012-05-18 at 19:00 -0400, Don Dutile wrote: On 05/18/2012 06:02 PM, Alex Williamson wrote: On Wed, 2012-05-16 at 09:29 -0400, Don Dutile wrote: On 05/15/2012 05:09 PM, Alex Williamson wrote: On Tue, 2012-05-15 at 13:56 -0600, Bjorn Helga

Re: [PATCH] spapr: Add "memop" hypercall

2012-05-21 Thread Benjamin Herrenschmidt
On Mon, 2012-05-21 at 13:07 +0300, Avi Kivity wrote: > > Now I'm adding another one, so yes, it's looking like a trend :-) I'll > > look into it, at this stage with only those two, adding some comments in > > the header might be plenty enough. > > Documentation/virtual/kvm/ppc-pv.txt is a nice cen

Re: [RFC][PATCH v2 00/11] uq/master: irqfd-based interrupt injection for virtio/vhost

2012-05-21 Thread Avi Kivity
On 05/21/2012 02:31 PM, Jan Kiszka wrote: > On 2012-05-20 11:45, Avi Kivity wrote: > > On 05/20/2012 05:42 PM, Michael S. Tsirkin wrote: > >> On Thu, May 17, 2012 at 10:32:28AM -0300, Jan Kiszka wrote: > >>> After this series, to only reasons to still use qemu-kvm for production > >>> purposes will

Re: [RFC][PATCH v2 00/11] uq/master: irqfd-based interrupt injection for virtio/vhost

2012-05-21 Thread Jan Kiszka
On 2012-05-20 11:45, Avi Kivity wrote: > On 05/20/2012 05:42 PM, Michael S. Tsirkin wrote: >> On Thu, May 17, 2012 at 10:32:28AM -0300, Jan Kiszka wrote: >>> After this series, to only reasons to still use qemu-kvm for production >>> purposes will be PCI device assignment >> >> Yay! >> >> By the wa

Re: [PATCH 4/4] Enabling Access bit when doing memory swapping

2012-05-21 Thread Avi Kivity
On 05/21/2012 02:17 PM, Hao, Xudong wrote: > > -Original Message- > > From: Avi Kivity [mailto:a...@redhat.com] > > Sent: Monday, May 21, 2012 6:48 PM > > To: Hao, Xudong > > Cc: Marcelo Tosatti; Xudong Hao; kvm@vger.kernel.org; > > linux-ker...@vger.kernel.org; Shan, Haitao; Zhang, Xiantao

RE: [PATCH 4/4] Enabling Access bit when doing memory swapping

2012-05-21 Thread Hao, Xudong
> -Original Message- > From: Avi Kivity [mailto:a...@redhat.com] > Sent: Monday, May 21, 2012 6:48 PM > To: Hao, Xudong > Cc: Marcelo Tosatti; Xudong Hao; kvm@vger.kernel.org; > linux-ker...@vger.kernel.org; Shan, Haitao; Zhang, Xiantao > Subject: Re: [PATCH 4/4] Enabling Access bit when do

Re: [PATCH 4/4] Enabling Access bit when doing memory swapping

2012-05-21 Thread Avi Kivity
On 05/21/2012 01:35 PM, Hao, Xudong wrote: > > > > That doesn't answer the question. An atomic operation is now non-atomic. > > > > You can calculate shadow_accessed_bit and keep on using clear_bit(), or > > switch to cmpxchg64(), but don't just drop the dirty bit here. > > > > I know your mean

RE: [PATCH 4/4] Enabling Access bit when doing memory swapping

2012-05-21 Thread Hao, Xudong
> -Original Message- > From: Avi Kivity [mailto:a...@redhat.com] > Sent: Monday, May 21, 2012 4:32 PM > To: Hao, Xudong > Cc: Marcelo Tosatti; Xudong Hao; kvm@vger.kernel.org; > linux-ker...@vger.kernel.org; Shan, Haitao; Zhang, Xiantao > Subject: Re: [PATCH 4/4] Enabling Access bit when do

Re: [PATCH] spapr: Add "memop" hypercall

2012-05-21 Thread Avi Kivity
On 05/21/2012 01:04 PM, Benjamin Herrenschmidt wrote: > On Mon, 2012-05-21 at 12:47 +0300, Avi Kivity wrote: > > On 05/21/2012 10:24 AM, Benjamin Herrenschmidt wrote: > > > This adds a kvm-specific hypervisor call to the pseries machine > > > which allows to do what amounts to memmove, memcpy and x

Re: [PATCH] spapr: Add "memop" hypercall

2012-05-21 Thread Benjamin Herrenschmidt
On Mon, 2012-05-21 at 12:47 +0300, Avi Kivity wrote: > On 05/21/2012 10:24 AM, Benjamin Herrenschmidt wrote: > > This adds a kvm-specific hypervisor call to the pseries machine > > which allows to do what amounts to memmove, memcpy and xor over > > regions of physical memory such as the framebuffer

  1   2   >