Re: [kvm-devel] extboot usage?

2008-04-04 Thread Jun Koi
On 4/3/08, Anthony Liguori <[EMAIL PROTECTED]> wrote: > Jun Koi wrote: > > > Hi, > > > > Could someone please post some concret examples on how to use extboot? > > I looked around, but saw nothing. > > > > > > Just append boot=on to your -drive parameter. > OK, but the question is that when I nee

[kvm-devel] kernel BUG at drivers/virtio/virtio_ring.c:218!

2008-04-04 Thread Balaji Rao
Hi Rusty, I hit a bug in virtio_ring.c:218 when I was stressing virtio_net using kvm with -smp 4. static void vring_disable_cb(struct virtqueue *_vq) { struct vring_virtqueue *vq = to_vvq(_vq); START_USE(vq); -->BUG_ON(vq->vring.avail->flags & VRING_AVAIL_F_NO_INTERRUPT)

Re: [kvm-devel] extboot usage?

2008-04-04 Thread Laurent Vivier
Le vendredi 04 avril 2008 à 18:29 +0900, Jun Koi a écrit : > On 4/3/08, Anthony Liguori <[EMAIL PROTECTED]> wrote: > > Jun Koi wrote: > > > > > Hi, > > > > > > Could someone please post some concret examples on how to use extboot? > > > I looked around, but saw nothing. > > > > > > > > > > Just a

Re: [kvm-devel] extboot usage?

2008-04-04 Thread Jun Koi
On 4/4/08, Laurent Vivier <[EMAIL PROTECTED]> wrote: > > Le vendredi 04 avril 2008 à 18:29 +0900, Jun Koi a écrit : > > > On 4/3/08, Anthony Liguori <[EMAIL PROTECTED]> wrote: > > > Jun Koi wrote: > > > > > > > Hi, > > > > > > > > Could someone please post some concret examples on how to use

Re: [kvm-devel] EMM: disable other notifiers before register and unregister

2008-04-04 Thread Andrea Arcangeli
On Thu, Apr 03, 2008 at 12:20:41PM -0700, Christoph Lameter wrote: > On Thu, 3 Apr 2008, Andrea Arcangeli wrote: > > > My attempt to fix this once and for all is to walk all vmas of the > > "mm" inside mmu_notifier_register and take all anon_vma locks and > > i_mmap_locks in virtual address order

[kvm-devel] [PATCH 01/04] kvm-s390: Some codingstyle issues.

2008-04-04 Thread Carsten Otte
From: Heiko Carstens <[EMAIL PROTECTED]> Just a few codingstyle issues that have already been commented on but that somehow got forgotten. Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]> Signed-off-by: Carsten Otte <[EMAIL PROTECTED]> --- arch/s390/kvm/gaccess.h | 18 ++ ar

[kvm-devel] [PATCH 04/04] kvm-s390: rename stfl to kvm_stfl

2008-04-04 Thread Carsten Otte
From: Heiko Carstens <[EMAIL PROTECTED]> Temporarily rename this function to avoid merge conflicts and/or dependencies. This function will be removed as soon as git-s390 and kvm.git are finally upstream. Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]> Signed-off-by: Carsten Otte <[EMAIL PROTECT

[kvm-devel] [PATCH 02/04] kvm-s390: Fix incorrect return value

2008-04-04 Thread Carsten Otte
From: Heiko Carstens <[EMAIL PROTECTED]> kvm_arch_vcpu_ioctl_run currently incorrectly always returns 0. Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]> Signed-off-by: Carsten Otte <[EMAIL PROTECTED]> --- arch/s390/kvm/kvm-s390.c |2 +- 1 files changed, 1 insertion(+), 1 deletion(-) Index

[kvm-devel] [PATCH 03/04] kvm-s390: Improve pgste accesses

2008-04-04 Thread Carsten Otte
From: Heiko Carstens <[EMAIL PROTECTED]> There is no need to use interlocked updates when the rcp lock is held. Therefore the simple bitops variants can be used. This should improve performance. Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]> Signed-off-by: Carsten Otte <[EMAIL PROTECTED]> ---

[kvm-devel] [PATCH 00/04] kvm-s390 updates

2008-04-04 Thread Carsten Otte
Hi Avi, looks like Heiko played around with kvm a bit :-): 01/04: cosmetics, including part of Arnd's review feedback 02/04: bugfix, if KVM_VCPU_IOCTL_RUN got interrupted by signal 03/04: performance improvement with our pgste memory handling 04/04: resolve merge conflict in linux-next kvm.git ver

[kvm-devel] Fantastic bargains for your luxury items.

2008-04-04 Thread Sanj Ekstrand
Pamper yourself to the maximum Get ready to live the luxurious life with your new collection of items http://www.kerinaes.com/ - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for

Re: [kvm-devel] [PATCH 03/04] kvm-s390: Improve pgste accesses

2008-04-04 Thread Martin Schwidefsky
On Fri, 2008-04-04 at 15:12 +0200, Carsten Otte wrote: > Index: kvm/include/asm-s390/pgtable.h > === > --- kvm.orig/include/asm-s390/pgtable.h > +++ kvm/include/asm-s390/pgtable.h > @@ -553,12 +553,12 @@ static inline void ptep_rcp_cop

Re: [kvm-devel] extboot usage?

2008-04-04 Thread Anthony Liguori
Jun Koi wrote: > On 4/4/08, Laurent Vivier <[EMAIL PROTECTED]> wrote: > >> Le vendredi 04 avril 2008 à 18:29 +0900, Jun Koi a écrit : >> >> >>> On 4/3/08, Anthony Liguori <[EMAIL PROTECTED]> wrote: >>> >> > > Jun Koi wrote: >> > > >> > > > Hi, >> > > > >> > > > Could someone pl

[kvm-devel] [PATCH 03/04 v2] kvm-s390: Improve pgste accesses

2008-04-04 Thread Carsten Otte
From: Heiko Carstens <[EMAIL PROTECTED]> There is no need to use interlocked updates when the rcp lock is held. Therefore the simple bitops variants can be used. This should improve performance. Signed-off-by: Heiko Carstens <[EMAIL PROTECTED]> Signed-off-by: Carsten Otte <[EMAIL PROTECTED]> ---

Re: [kvm-devel] [PATCH 03/04] kvm-s390: Improve pgste accesses

2008-04-04 Thread Carsten Otte
[EMAIL PROTECTED] wrote: > Major formatting accident ? Ops! How did that happen? Thanks, will resend that patch. - Check out the new SourceForge.net Marketplace. It's the best place to buy or sell services for just abo

Re: [kvm-devel] Ubuntu Gutsy host / XP guest / -smp 2

2008-04-04 Thread David Abrahams
on Wed Apr 02 2008, Avi Kivity wrote: > David Abrahams wrote: >> With the title combination, the guest takes nearly 100% of my real CPU >> time and still only sees one CPU. Is this a known problem, and does it >> have a known solution? >> >> > > Can you send the output of 'kvm_stat -1'? $

Re: [kvm-devel] QEMU/KVM: make kvm_arch_load_regs() aware of in kernel APIC

2008-04-04 Thread Ryan Harper
* Marcelo Tosatti <[EMAIL PROTECTED]> [2008-04-03 18:22]: > > kvm_arch_load_regs() might load APIC base and APIC TPR from the > uninitialized userspace APIC emulation. > > This happened when running X11 on SMP guest in my case, disabling the > APIC for vcpu3: > > vcpu not ready for apic_round_ro

[kvm-devel] [PATCH] prepopulate guest pages after write-protecting

2008-04-04 Thread Marcelo Tosatti
Zdenek reported a bug where a looping "dmsetup status" eventually hangs on SMP guests. The problem is that kvm_mmu_get_page() prepopulates the shadow MMU before write protecting the guest page tables. By doing so, it leaves a window open where the guest can mark a pte as present while the host ha

Re: [kvm-devel] [PATCH] prepopulate guest pages after write-protecting

2008-04-04 Thread Zdenek Kabelac
2008/4/4, Marcelo Tosatti <[EMAIL PROTECTED]>: > > Zdenek reported a bug where a looping "dmsetup status" eventually hangs > on SMP guests. > > The problem is that kvm_mmu_get_page() prepopulates the shadow MMU > before write protecting the guest page tables. By doing so, it leaves a > window

[kvm-devel] [PATCH] account for start offset on largepage aligned-sized memslots

2008-04-04 Thread Marcelo Tosatti
Account for the case where memslot size is largepage aligned, but does not start on largepage aligned offset. Otherwise it allocates one lpage_info struct less than what the memslot spans, possibly resulting in memory corruption. Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]> diff --git

[kvm-devel] [PATCH] mmu notifier #v11

2008-04-04 Thread Andrea Arcangeli
This should guarantee that nobody can register when any of the mmu notifiers is running avoiding all the races including guaranteeing range_start not to be missed. I'll adapt the other patches to provide the sleeping-feature on top of this (only needed by XPMEM) soon. KVM seems to run fine on top o

Re: [kvm-devel] [PATCH] prepopulate guest pages after write-protecting

2008-04-04 Thread Avi Kivity
Marcelo Tosatti wrote: > Zdenek reported a bug where a looping "dmsetup status" eventually hangs > on SMP guests. > > The problem is that kvm_mmu_get_page() prepopulates the shadow MMU > before write protecting the guest page tables. By doing so, it leaves a > window open where the guest can mark a

Re: [kvm-devel] [PATCH 03/04] kvm-s390: Improve pgste accesses

2008-04-04 Thread Avi Kivity
Carsten Otte wrote: > From: Heiko Carstens <[EMAIL PROTECTED]> > > There is no need to use interlocked updates when the rcp > lock is held. Therefore the simple bitops variants can be > used. This should improve performance. > > skey = page_get_storage_key(page_to_phys(page)); > if (skey & _PAGE_CH

Re: [kvm-devel] [PATCH 00/04] kvm-s390 updates

2008-04-04 Thread Avi Kivity
Carsten Otte wrote: > Hi Avi, > > looks like Heiko played around with kvm a bit :-): > 01/04: cosmetics, including part of Arnd's review feedback > 02/04: bugfix, if KVM_VCPU_IOCTL_RUN got interrupted by signal > 03/04: performance improvement with our pgste memory handling > 04/04: resolve merge c

Re: [kvm-devel] [PATCH 03/04 v2] kvm-s390: Improve pgste accesses

2008-04-04 Thread Avi Kivity
Carsten Otte wrote: > From: Heiko Carstens <[EMAIL PROTECTED]> > > There is no need to use interlocked updates when the rcp > lock is held. Therefore the simple bitops variants can be > used. This should improve performance. > > Applied this fixed patch as well, thanks. -- Any sufficiently dif

Re: [kvm-devel] [PATCH] Fix vmmouse with -smp

2008-04-04 Thread Avi Kivity
Anthony Liguori wrote: > The vmport code is very broken for SMP guests. It uses a global CPUState > that's initialized multiple times? At any rate, since it needs to know CPU > registers for the current CPU in a PIO handler, it needs to use > cpu_single_env. > > This patch makes vmmouse when usi

Re: [kvm-devel] QEMU/KVM: make kvm_arch_load_regs() aware of in kernel APIC

2008-04-04 Thread Avi Kivity
Marcelo Tosatti wrote: > kvm_arch_load_regs() might load APIC base and APIC TPR from the > uninitialized userspace APIC emulation. > > This happened when running X11 on SMP guest in my case, disabling the > APIC for vcpu3: > > vcpu not ready for apic_round_robin > vcpu not ready for apic_round_robi

Re: [kvm-devel] [PATCH] account for start offset on largepage aligned-sized memslots

2008-04-04 Thread Avi Kivity
Marcelo Tosatti wrote: > Account for the case where memslot size is largepage aligned, but does not > start on largepage aligned offset. > > Otherwise it allocates one lpage_info struct less than what the memslot > spans, possibly resulting in memory corruption. > Applied, thanks. -- Any suf

[kvm-devel] [PATCH] Fix external module install for new host kernels

2008-04-04 Thread Anthony Liguori
KVM kernel modules are now located in arch/x86/kvm so make sure to rename those too. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/kernel/Makefile b/kernel/Makefile index fb053eb..c30c8b2 100644 --- a/kernel/Makefile +++ b/kernel/Makefile @@ -61,7 +61,8 @@ sync: install:

Re: [kvm-devel] [PATCH] mmu notifier #v11

2008-04-04 Thread Christoph Lameter
I am always the guy doing the cleanup after Andrea it seems. Sigh. Here is the mm_lock/mm_unlock logic separated out for easier review. Adds some comments. Still objectionable is the multiple ways of invalidating pages in #v11. Callout now has similar locking to emm. From: Christoph Lameter <[EMA

[kvm-devel] [patch 04/10] emm: Convert i_mmap_lock to i_mmap_sem

2008-04-04 Thread Christoph Lameter
The conversion to a rwsem allows callbacks during rmap traversal for files in a non atomic context. A rw style lock also allows concurrent walking of the reverse map. This is fairly straightforward if one removes pieces of the resched checking. [Restarting unmapping is an issue to be discussed].

[kvm-devel] [patch 01/10] emm: mm_lock: Lock a process against reclaim

2008-04-04 Thread Christoph Lameter
Provide a way to lock an mm_struct against reclaim (try_to_unmap etc). This is necessary for the invalidate notifier approaches so that they can reliably add and remove a notifier. Signed-off-by: Andrea Arcangeli <[EMAIL PROTECTED]> Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]> --- includ

[kvm-devel] [patch 02/10] emm: notifier logic

2008-04-04 Thread Christoph Lameter
This patch implements a simple callback for device drivers that establish their own references to pages (KVM, GRU, XPmem, RDMA/Infiniband, DMA engines etc). These references are unknown to the VM (therefore external). With these callbacks it is possible for the device driver to release external re

[kvm-devel] [patch 06/10] emm: Convert anon_vma lock to rw_sem and refcount

2008-04-04 Thread Christoph Lameter
Convert the anon_vma spinlock to a rw semaphore. This allows concurrent traversal of reverse maps for try_to_unmap and page_mkclean. It also allows the calling of sleeping functions from reverse map traversal. An additional complication is that rcu is used in some context to guarantee the presence

[kvm-devel] [patch 10/10] xpmem: Simple example

2008-04-04 Thread Christoph Lameter
A simple test program (well actually a pair). They are fairly easy to use. NOTE: the xpmem.h is copied from the kernel/drivers/misc/xp/xpmem.h file. Type make. Then from one session, type ./A1. Grab the first line of output which should begin with ./A2 and paste the whole line into a second se

[kvm-devel] [patch 00/10] [RFC] EMM Notifier V3

2008-04-04 Thread Christoph Lameter
V2->V3: - Fix rcu issues - Fix emm_referenced handling - Use Andrea's mm_lock/unlock to prevent registration races. - Keep simple API since there does not seem to be a need to add additional callbacks (mm_lock does not require callbacks like emm_start/stop that I envisioned). - Reduce CC list (

[kvm-devel] [patch 03/10] emm: Move tlb flushing into free_pgtables

2008-04-04 Thread Christoph Lameter
Move the tlb flushing into free_pgtables. The conversion of the locks taken for reverse map scanning would require taking sleeping locks in free_pgtables(). Moving the tlb flushing into free_pgtables allows sleeping in parts of free_pgtables(). This means that we do a tlb_finish_mmu() before freei

[kvm-devel] [patch 05/10] emm: Remove tlb pointer from the parameters of unmap vmas

2008-04-04 Thread Christoph Lameter
We no longer abort unmapping in unmap vmas because we can reschedule while unmapping since we are holding a semaphore. This would allow moving more of the tlb flusing into unmap_vmas reducing code in various places. Signed-off-by: Christoph Lameter <[EMAIL PROTECTED]> --- include/linux/mm.h |

[kvm-devel] [patch 07/10] xpmem: This patch exports zap_page_range as it is needed by XPMEM.

2008-04-04 Thread Christoph Lameter
XPMEM would have used sys_madvise() except that madvise_dontneed() returns an -EINVAL if VM_PFNMAP is set, which is always true for the pages XPMEM imports from other partitions and is also true for uncached pages allocated locally via the mspec allocator. XPMEM needs zap_page_range() functionalit

[kvm-devel] [patch 08/10] xpmem: Locking rules for taking multiple mmap_sem locks.

2008-04-04 Thread Christoph Lameter
This patch adds a lock ordering rule to avoid a potential deadlock when multiple mmap_sems need to be locked. Signed-off-by: Dean Nelson <[EMAIL PROTECTED]> --- mm/filemap.c |3 +++ 1 file changed, 3 insertions(+) Index: linux-2.6/mm/filemap.c ===

Re: [kvm-devel] [patch 01/10] emm: mm_lock: Lock a process against reclaim

2008-04-04 Thread Jeremy Fitzhardinge
Christoph Lameter wrote: > Provide a way to lock an mm_struct against reclaim (try_to_unmap > etc). This is necessary for the invalidate notifier approaches so > that they can reliably add and remove a notifier. > > Signed-off-by: Andrea Arcangeli <[EMAIL PROTECTED]> > Signed-off-by: Christoph Lame

[kvm-devel] Need info on guest swapping and other things in KVM

2008-04-04 Thread Arjun
Hi Folks, A fellow student and I wish to do run some experiments with KVM. Specifically, we would like to examine KVM's guest paging/swapping mechanism, make some changes and run some tests. After a brief search through the docs and code, we would greatly appreciate help with the following: 1) Gu

Re: [kvm-devel] [PATCH] mmu notifier #v11

2008-04-04 Thread Andrea Arcangeli
On Fri, Apr 04, 2008 at 03:06:18PM -0700, Christoph Lameter wrote: > Adds some comments. Still objectionable is the multiple ways of > invalidating pages in #v11. Callout now has similar locking to emm. range_begin exists because range_end is called after the page has already been freed. invalidat

Re: [kvm-devel] [patch 01/10] emm: mm_lock: Lock a process against reclaim

2008-04-04 Thread Andrea Arcangeli
On Fri, Apr 04, 2008 at 04:12:42PM -0700, Jeremy Fitzhardinge wrote: > I think you can break this if() down a bit: > > if (!(vma->vm_file && vma->vm_file->f_mapping)) > continue; It makes no difference at runtime, coding style preferences are qui

Re: [kvm-devel] [patch 02/10] emm: notifier logic

2008-04-04 Thread Andrea Arcangeli
On Fri, Apr 04, 2008 at 03:30:50PM -0700, Christoph Lameter wrote: > + mm_lock(mm); > + e->next = mm->emm_notifier; > + /* > + * The update to emm_notifier (e->next) must be visible > + * before the pointer becomes visible. > + * rcu_assign_pointer() does exactly what we

Re: [kvm-devel] [Qemu-devel] [PATCH 3/6] virtio for QEMU

2008-04-04 Thread Anthony Liguori
Dor Laor wrote: > >> +static uint32_t vring_desc_len(VirtQueue *vq, unsigned int i) >> +{ > > Below there were place you did use offsetof(vq->vring.desc[i], len) so > we better be consistent + its nicer > >> +return ldl_phys(vq->vring.desc + i * sizeof(VRingDesc) + >> +offse

[kvm-devel] [PATCH 2/6] PCI DMA API (v2)

2008-04-04 Thread Anthony Liguori
This patch introduces a PCI DMA API and some generic code to support other DMA APIs. It introduces a IOVector type that contains physical address/length pairs. These vectors can be translated by the PCI layer and passed either to generic copying functions or directly to the block or network subsy

[kvm-devel] [PATCH 1/6] Use ram_addr_t for cpu_get_physical_page_desc (v2)

2008-04-04 Thread Anthony Liguori
uint32_t is the wrong type to use to represent physical addresses. This patch is unchanged since v1. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/cpu-all.h b/cpu-all.h index 2a2b197..9e5d33b 100644 --- a/cpu-all.h +++ b/cpu-all.h @@ -834,7 +834,7 @@ typedef uint32_t CPUReadMem

[kvm-devel] [PATCH 4/6] virtio network driver (v2)

2008-04-04 Thread Anthony Liguori
This patch implements the virtio network driver backend. In KVM, this driver can achieve 1gbit tx/rx performance. More patches are required to improve the network IO infrastructure to achieve better performance in QEMU. Since v1, I've updated the patch based on the IOVector refactoring. Signed-

[kvm-devel] [PATCH 6/6] virtio balloon driver (v2)

2008-04-04 Thread Anthony Liguori
This patch implements the virtio balloon driver backend. A user can interact with the balloon driver using a newly introduce monitor command 'balloon'. Ballooning is used to request the guest to stop using a certain portion of its memory. The guest notifies the host of this memory so the host ca

[kvm-devel] [PATCH 3/6] virtio for QEMU (v2)

2008-04-04 Thread Anthony Liguori
This patch introduces virtio support over PCI. virtio is a generic virtual IO framework for Linux first introduced in 2.6.23. Since 2.6.25, virtio has supported a PCI transport which this patch implements. Since the last time these patches were posted to qemu-devel, I've reworked it to use the p

[kvm-devel] [PATCH 5/6] virtio block driver (v2)

2008-04-04 Thread Anthony Liguori
This patch implements the virtio block driver backend. Since v1, I've updated the patch based on the IOVector refactoring and fixed an endianness bug in the config space. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/Makefile.target b/Makefile.target index 3ea40d1..f9fe660 1006