[kvm-devel] [PATCH 2/3] virtio-net save/restore support

2008-05-08 Thread Anthony Liguori
The only interesting bit here is that we have to ensure that we rearm the timer if necessary. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/virtio-net.c b/qemu/hw/virtio-net.c index d15c2f4..5fe66ac 100644 --- a/qemu/hw/virtio-net.c +++ b/qemu/hw/virtio-net.c @@ -207,9 +

[kvm-devel] [PATCH 2/3] Make virtio-net can_receive more accurate (v2)

2008-05-04 Thread Anthony Liguori
In the final patch of this series, we rely on a VLAN client's fd_can_read method to avoid dropping packets. Unfortunately, virtio's fd_can_read method is not very accurate at the moment. This patch addresses this. It also generates a notification to the IO thread when more RX packets become avai

[kvm-devel] [PATCH 2/3] Interrupt io thread in qemu_set_fd_handler2

2008-05-04 Thread Anthony Liguori
The select() in the IO thread may wait a long time before rebuilding the fd set. Whenever we do something that changes the fd set, we should interrupt the IO thread. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/vl.c b/qemu/vl.c index 1192759..e9f0ca4 100644 --- a/qemu/vl.

[kvm-devel] [patch 2/3] QEMU/KVM: ACPI PCI hotplug multiple bus support

2008-05-02 Thread Marcelo Tosatti
Support more than one bus in the ACPI PCI hotplug code. Currently 4 buses are supported, but can be easily extended. Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]> Index: kvm-userspace.pci3/qemu/hw/acpi.c === --- kvm-userspace.p

[kvm-devel] [PATCH 2/3] Split out posix-aio code

2008-04-17 Thread Anthony Liguori
This patch moves the posix-aio code into a separate file. It's strictly code motion, no new functionality is introduced. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/Makefile b/Makefile index a8df278..916f071 100644 --- a/Makefile +++ b/Makefile @@ -139,7 +139,7 @@ QEMU_IMG_BL

[kvm-devel] [PATCH 2/3] map regions as registered

2008-04-16 Thread Glauber de Oliveira Costa
From: Glauber Costa <[EMAIL PROTECTED]> map which io registers where already sucessfuly registered Signed-off-by: Glauber Costa <[EMAIL PROTECTED]> --- qemu/hw/pci.c |5 +++-- qemu/hw/pci.h |3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/qemu/hw/pci.c b/qemu/hw/pci

[kvm-devel] [PATCH 2/3] SVM: align shadow CR4.MCE with host

2008-04-09 Thread Joerg Roedel
This patch aligns the host version of the CR4.MCE bit with the CR4 active in the guest. This is necessary to get MCE exceptions when the guest is running. Signed-off-by: Joerg Roedel <[EMAIL PROTECTED]> --- arch/x86/kvm/svm.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --gi

[kvm-devel] [patch 2/3] QEMU/KVM: add function to handle signals

2008-04-02 Thread Marcelo Tosatti
SIGUSR1 has no handler, and the SIGUSR2 one does nothing useful anymore (thats also true for SIGIO on tap fd, which runs host_alarm_handler unnecessarily). Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]> Index: kvm-userspace.io/qemu/qemu-kvm.c

Re: [kvm-devel] [patch 2/3] QEMU/KVM: add function to handle signals

2008-03-27 Thread Avi Kivity
Marcelo Tosatti wrote: > SIGUSR1 has no handler, and the SIGUSR2 one does nothing useful anymore > (thats also true for SIGIO on tap fd, which runs host_alarm_handler > unnecessarily). > > This one prevents alt+F4 from closing the sdl window (X over ssh), so I'm backing it out. I'm getting

Re: [kvm-devel] [patch 2/3] QEMU/KVM: add function to handle signals

2008-03-27 Thread Avi Kivity
Marcelo Tosatti wrote: > On Thu, Mar 27, 2008 at 05:25:20PM +0200, Avi Kivity wrote: > >> Marcelo Tosatti wrote: >> >>> SIGUSR1 has no handler, and the SIGUSR2 one does nothing useful anymore >>> (thats also true for SIGIO on tap fd, which runs host_alarm_handler >>> unnecessarily). >>>

Re: [kvm-devel] [patch 2/3] QEMU/KVM: add function to handle signals

2008-03-27 Thread Marcelo Tosatti
On Thu, Mar 27, 2008 at 05:25:20PM +0200, Avi Kivity wrote: > Marcelo Tosatti wrote: > >SIGUSR1 has no handler, and the SIGUSR2 one does nothing useful anymore > >(thats also true for SIGIO on tap fd, which runs host_alarm_handler > >unnecessarily). > > > > The sigaction(); sa.sa_handler() stu

Re: [kvm-devel] [patch 2/3] QEMU/KVM: add function to handle signals

2008-03-27 Thread Avi Kivity
Marcelo Tosatti wrote: > SIGUSR1 has no handler, and the SIGUSR2 one does nothing useful anymore > (thats also true for SIGIO on tap fd, which runs host_alarm_handler > unnecessarily). > The sigaction(); sa.sa_handler() stuff was added as a stopgap; do we actually need to run _any_ signal ha

[kvm-devel] [patch 2/3] QEMU/KVM: add function to handle signals

2008-03-27 Thread Marcelo Tosatti
SIGUSR1 has no handler, and the SIGUSR2 one does nothing useful anymore (thats also true for SIGIO on tap fd, which runs host_alarm_handler unnecessarily). Index: kvm-userspace.io/qemu/qemu-kvm.c === --- kvm-userspace.io.orig/qemu/q

Re: [kvm-devel] [PATCH 2/3] [PATCH] unregister pci device

2008-03-27 Thread Avi Kivity
Glauber Costa wrote: > Avi Kivity wrote: >> Glauber Costa wrote: >>> If we fail after we have allocated the pci device, we have >>> to get rid of it. Otherwise, a bogus device will be found on >>> the bus >>> >> >> Maybe, alter the order so the device is registered last thing. This >> may help

Re: [kvm-devel] [PATCH 2/3] [PATCH] unregister pci device

2008-03-27 Thread Glauber Costa
Avi Kivity wrote: > Glauber Costa wrote: >> If we fail after we have allocated the pci device, we have >> to get rid of it. Otherwise, a bogus device will be found on >> the bus >> > > Maybe, alter the order so the device is registered last thing. This may > help avoid races with pci passthro

Re: [kvm-devel] [PATCH 2/3] [PATCH] unregister pci device

2008-03-27 Thread Avi Kivity
Glauber Costa wrote: > If we fail after we have allocated the pci device, we have > to get rid of it. Otherwise, a bogus device will be found on > the bus > Maybe, alter the order so the device is registered last thing. This may help avoid races with pci passthrough hotplug. -- error compil

[kvm-devel] [PATCH 2/3] [PATCH] unregister pci device

2008-03-26 Thread Glauber Costa
If we fail after we have allocated the pci device, we have to get rid of it. Otherwise, a bogus device will be found on the bus Signed-off-by: Glauber Costa <[EMAIL PROTECTED]> --- qemu/hw/passthrough/passthrough.c | 11 +++ qemu/hw/pci.c |6 ++ qemu/hw/pci.h

[kvm-devel] [PATCH 2/3] [PATCH] make native_machine_shutdown non-static

2008-03-18 Thread Glauber Costa
it will allow external users to call it. It is mainly useful for routines that will override its machine_ops field for its own special purposes, but want to call the normal shutdown routine after they're done Signed-off-by: Glauber Costa <[EMAIL PROTECTED]> --- arch/x86/kernel/reboot.c |2 +-

[kvm-devel] [patch 2/3] QEMU/KVM: virtio register pow2 memory regions

2008-03-17 Thread Marcelo Tosatti
Otherwise the PCI size for such regions will be calculated erroneously. Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]> Cc: Anthony Liguori <[EMAIL PROTECTED]> Index: kvm-userspace.hotplug3/qemu/hw/virtio.c === --- kvm-userspace.h

[kvm-devel] [PATCH 2/3] make native_machine_shutdown non-static

2008-03-17 Thread Glauber Costa
it will allow external users to call it. It is mainly useful for routines that will override its machine_ops field for its own special purposes, but want to call the normal shutdown routine after they're done Signed-off-by: Glauber Costa <[EMAIL PROTECTED]> --- arch/x86/kernel/reboot.c |2 +-

[kvm-devel] [patch 2/3] QEMU: balloon: dont allow target larger than ram size

2008-03-12 Thread Marcelo Tosatti
Truncate the target size to be at most ram size. Signed-off-by: Marcelo Tosatti <[EMAIL PROTECTED]> Index: kvm-userspace.balloon/qemu/hw/virtio-balloon.c === --- kvm-userspace.balloon.orig/qemu/hw/virtio-balloon.c +++ kvm-userspace.b

[kvm-devel] [PATCH 2/3] Factor out the VGA vram mapping updating routine

2008-02-22 Thread Anthony Liguori
This function is useful for enabling KVM support in VMware VGA. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/vga.c b/qemu/hw/vga.c index 222a39c..1cfc154 100644 --- a/qemu/hw/vga.c +++ b/qemu/hw/vga.c @@ -1813,6 +1813,36 @@ typedef struct PCIVGAState { VGAState vga

[kvm-devel] [PATCH 2/3] x86, kvm: make register_address, address_mask static inlines

2008-02-19 Thread Harvey Harrison
Signed-off-by: Harvey Harrison <[EMAIL PROTECTED]> --- Against kvm.git:master arch/x86/kvm/x86_emulate.c | 48 ++- 1 files changed, 29 insertions(+), 19 deletions(-) diff --git a/arch/x86/kvm/x86_emulate.c b/arch/x86/kvm/x86_emulate.c index f6f6544..008db

[kvm-devel] [PATCH 2/3] KVM: SVM: allocate the MSR permission map per VCPU

2008-02-13 Thread Joerg Roedel
This patch changes the kvm-amd module to allocate the SVM MSR permission map per VCPU instead of a global map for all VCPUs. With this we have more flexibility allowing specific guests to access virtualized MSRs. This is required for LBR virtualization. Signed-off-by: Joerg Roedel <[EMAIL PROTECTE

[kvm-devel] [PATCH 2/3] KVM: SVM: allocate the MSR permission map per VCPU

2008-02-12 Thread Joerg Roedel
This patch changes the kvm-amd module to allocate the SVM MSR permission map per VCPU instead of a global map for all VCPUs. With this we have more flexibility allowing specific guests to access virtualized MSRs. This is required for LBRV virtualization. Signed-off-by: Joerg Roedel <[EMAIL PROTECT

Re: [kvm-devel] [patch 2/3] mmu_notifier: Callbacks to invalidate address ranges

2008-02-01 Thread Christoph Lameter
On Fri, 1 Feb 2008, Robin Holt wrote: > Maybe I haven't looked closely enough, but let's start with some common > assumptions. Looking at do_wp_page from 2.6.24 (I believe that is what > my work area is based upon). On line 1559, the function begins being > declared. Aah I looked at the wrong f

Re: [kvm-devel] [patch 2/3] mmu_notifier: Callbacks to invalidate address ranges

2008-02-01 Thread Robin Holt
On Fri, Feb 01, 2008 at 04:32:21AM -0600, Robin Holt wrote: > On Thu, Jan 31, 2008 at 08:43:58PM -0800, Christoph Lameter wrote: > > On Thu, 31 Jan 2008, Robin Holt wrote: > > > > > > Index: linux-2.6/mm/memory.c > > > ... > > > > @@ -1668,6 +1678,7 @@ gotten: > > > > page_cache_re

Re: [kvm-devel] [patch 2/3] mmu_notifier: Callbacks to invalidate address ranges

2008-02-01 Thread Robin Holt
On Thu, Jan 31, 2008 at 08:43:58PM -0800, Christoph Lameter wrote: > On Thu, 31 Jan 2008, Robin Holt wrote: > > > > Index: linux-2.6/mm/memory.c > > ... > > > @@ -1668,6 +1678,7 @@ gotten: > > > page_cache_release(old_page); > > > unlock: > > > pte_unmap_unlock(page_table, ptl); > > >

Re: [kvm-devel] [patch 2/3] mmu_notifier: Callbacks to invalidate address ranges

2008-01-31 Thread Christoph Lameter
On Thu, 31 Jan 2008, Robin Holt wrote: > > Index: linux-2.6/mm/memory.c > ... > > @@ -1668,6 +1678,7 @@ gotten: > > page_cache_release(old_page); > > unlock: > > pte_unmap_unlock(page_table, ptl); > > + mmu_notifier(invalidate_range_end, mm, 0); > > I think we can get an _end c

Re: [kvm-devel] [patch 2/3] mmu_notifier: Callbacks to invalidate address ranges

2008-01-31 Thread Robin Holt
> Index: linux-2.6/mm/memory.c ... > @@ -1668,6 +1678,7 @@ gotten: > page_cache_release(old_page); > unlock: > pte_unmap_unlock(page_table, ptl); > + mmu_notifier(invalidate_range_end, mm, 0); I think we can get an _end call without the _begin call before it. Thanks, Robi

Re: [kvm-devel] [patch 2/3] mmu_notifier: Callbacks to invalidate address ranges

2008-01-31 Thread Christoph Lameter
On Thu, 31 Jan 2008, Andrea Arcangeli wrote: > On Wed, Jan 30, 2008 at 08:57:52PM -0800, Christoph Lameter wrote: > > @@ -211,7 +212,9 @@ asmlinkage long sys_remap_file_pages(uns > > spin_unlock(&mapping->i_mmap_lock); > > } > > > > + mmu_notifier(invalidate_range_begin, mm, st

Re: [kvm-devel] [patch 2/3] mmu_notifier: Callbacks to invalidate address ranges

2008-01-31 Thread Andrea Arcangeli
On Wed, Jan 30, 2008 at 08:57:52PM -0800, Christoph Lameter wrote: > @@ -211,7 +212,9 @@ asmlinkage long sys_remap_file_pages(uns > spin_unlock(&mapping->i_mmap_lock); > } > > + mmu_notifier(invalidate_range_begin, mm, start, start + size, 0); > err = populate_range(

[kvm-devel] [patch 2/3] mmu_notifier: Callbacks to invalidate address ranges

2008-01-30 Thread Christoph Lameter
The invalidation of address ranges in a mm_struct needs to be performed when pages are removed or permissions etc change. invalidate_range_begin/end() is frequently called with only mmap_sem held. If invalidate_range_begin() is called with locks held then we pass a flag into invalidate_range() to

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2008-01-16 Thread Avi Kivity
Gerd Hoffmann wrote: > Hi, > > >> We want to avoid updating wall clock all the time. As far as I >> understand, wall clock is just a base which doesn't change. >> > > Yep, it is. Got that wrong first in xenner, with the result that guest > time ran at double speed ;) > > >>> +/* xen

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2008-01-16 Thread Gerd Hoffmann
Hi, > We want to avoid updating wall clock all the time. As far as I > understand, wall clock is just a base which doesn't change. Yep, it is. Got that wrong first in xenner, with the result that guest time ran at double speed ;) >> +/* xen binary-compatible interfaces. See xen headers for

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2008-01-16 Thread Avi Kivity
Glauber de Oliveira Costa wrote: > +static void kvm_write_guest_time(struct kvm_vcpu *v) > +{ > + struct timespec ts, wc_ts; > + int wc_args[3]; /* version, wc_sec, wc_nsec */ > + unsigned long flags; > + struct kvm_vcpu_arch *vcpu = &v->arch; > + struct xen_shared_info *shared

[kvm-devel] [PATCH 2/3] kvmclock - the host part.

2008-01-15 Thread Glauber de Oliveira Costa
This is the host part of kvm clocksource implementation. As it does not include clockevents, it is a fairly simple implementation. We only have to register a per-vcpu area, and start writting to it periodically. The area is binary compatible with xen, as we use the same shadow_info structure. Si

Re: [kvm-devel] [PATCH 2/3] [PATCH] kvmclock - the host part.

2008-01-12 Thread Anthony Liguori
Avi Kivity wrote: > Anthony Liguori wrote: >> Glauber de Oliveira Costa wrote: >> >>> This is the host part of kvm clocksource implementation. As it does >>> not include clockevents, it is a fairly simple implementation. We >>> only have to register a per-vcpu area, and start writting to it >>>

Re: [kvm-devel] [PATCH 2/3] [PATCH] kvmclock - the host part.

2008-01-12 Thread Avi Kivity
Anthony Liguori wrote: > Glauber de Oliveira Costa wrote: > >> This is the host part of kvm clocksource implementation. As it does >> not include clockevents, it is a fairly simple implementation. We >> only have to register a per-vcpu area, and start writting to it periodically. >> >> The area

Re: [kvm-devel] [PATCH 2/3] [PATCH] kvmclock - the host part.

2008-01-12 Thread Avi Kivity
Glauber de Oliveira Costa wrote: > This is the host part of kvm clocksource implementation. As it does > not include clockevents, it is a fairly simple implementation. We > only have to register a per-vcpu area, and start writting to it periodically. > > The area is binary compatible with xen, as w

Re: [kvm-devel] [PATCH 2/3] [PATCH] kvmclock - the host part.

2008-01-11 Thread Anthony Liguori
Glauber de Oliveira Costa wrote: > This is the host part of kvm clocksource implementation. As it does > not include clockevents, it is a fairly simple implementation. We > only have to register a per-vcpu area, and start writting to it periodically. > > The area is binary compatible with xen, as w

[kvm-devel] [PATCH 2/3] [PATCH] kvmclock - the host part.

2008-01-11 Thread Glauber de Oliveira Costa
This is the host part of kvm clocksource implementation. As it does not include clockevents, it is a fairly simple implementation. We only have to register a per-vcpu area, and start writting to it periodically. The area is binary compatible with xen, as we use the same shadow_info structure. Si

[kvm-devel] [PATCH 2/3] Add PowerPC kvmctl harness and fix building the testcases

2008-01-09 Thread Christian Ehrhardt
Subject: [PATCH 2/3] Add PowerPC kvmctl harness and fix building the testcases From: Hollis Blanchard <[EMAIL PROTECTED]> From: Christian Ehrhardt <[EMAIL PROTECTED]> These patches get the kvm-userspace/user/ test harness building and somewhat working for PowerPC. For the moment it's just a simply

[kvm-devel] [PATCH 2/3] Add support for VRING_USED_F_NOTIFY_ON_FULL

2008-01-07 Thread Anthony Liguori
This patch adds support for VRING_USED_F_NOTIFY_ON_FULL. When this bit is set, virtio ring notifications will be suppressed unless the virtio ring is full. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 1302ac4..e

[kvm-devel] [PATCH 2/3] Make virtio_pci license be GPL2+

2008-01-02 Thread Anthony Liguori
This patch changes the virtio_pci license to be GPL2 or later. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/drivers/virtio/virtio_pci.c b/drivers/virtio/virtio_pci.c index 45ff193..f8df571 100644 --- a/drivers/virtio/virtio_pci.c +++ b/drivers/virtio/virtio_pci.c @@ -9,8 +9,8 @

Re: [kvm-devel] [Patch][2/3] Move kvm_mmu init and exit functionality to arch.

2007-11-19 Thread Carsten Otte
Zhang, Xiantao wrote: > Move kvm_mmu init and exit functionality to arch. Acked-by: Carsten Otte <[EMAIL PROTECTED]> - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://

[kvm-devel] [Patch][2/3] Move kvm_mmu init and exit functionality to arch.

2007-11-18 Thread Zhang, Xiantao
Move kvm_mmu init and exit functionality to arch. Xiantao 0002-KVM-Portability-MMU-split.patch Description: 0002-KVM-Portability-MMU-split.patch - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2007-11-13 Thread Dong, Eddie
>> >> +kvm_get_msr(vcpu, MSR_IA32_TIME_STAMP_COUNTER, >> + &vcpu->hv_clock.last_tsc); >> + >> +ktime_get_ts(&ts); >> +vcpu->hv_clock.now_ns = ts.tv_nsec + (NSEC_PER_SEC * >> (u64)ts.tv_sec); + vcpu->hv_clock.wc_sec = get_seconds(); >> >> I am even thinking we ha

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2007-11-13 Thread Avi Kivity
Dong, Eddie wrote: >>> >>> After thinking for a little while, you are theoretically right. >>> In the current state, we could even be preempted between all >>> operations ;-) Maybe after avi's suggestion of moving the call to it >>> it will end up in a preempt safe region, but anyway, it's safer to

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2007-11-13 Thread Dong, Eddie
Avi Kivity wrote: > Glauber de Oliveira Costa wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Dong, Eddie escreveu: >> +static void kvm_write_guest_time(struct kvm_vcpu *vcpu) +{ + struct timespec ts; + int r; + + if (!vcpu->clock_gpa) + retu

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2007-11-13 Thread Avi Kivity
Glauber de Oliveira Costa wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Dong, Eddie escreveu: > >>> +static void kvm_write_guest_time(struct kvm_vcpu *vcpu) +{ >>> + struct timespec ts; >>> + int r; >>> + >>> + if (!vcpu->clock_gpa) >>> + return; >>> + >>> + /* U

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2007-11-13 Thread Avi Kivity
Glauber de Oliveira Costa wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Avi Kivity escreveu: > >> Glauber de Oliveira Costa wrote: >> >>> This is the host part of kvm clocksource implementation. As it does >>> not include clockevents, it is a fairly simple implementation. We

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2007-11-13 Thread Izik Eidus
Glauber de Oliveira Costa wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Dong, Eddie escreveu: > >>> +static void kvm_write_guest_time(struct kvm_vcpu *vcpu) +{ >>> + struct timespec ts; >>> + int r; >>> + >>> + if (!vcpu->clock_gpa) >>> + return; >>> + >>> + /* U

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2007-11-13 Thread Glauber de Oliveira Costa
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Dong, Eddie escreveu: >> +static void kvm_write_guest_time(struct kvm_vcpu *vcpu) +{ >> +struct timespec ts; >> +int r; >> + >> +if (!vcpu->clock_gpa) >> +return; >> + >> +/* Updates version to the next odd number, indicatin

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2007-11-13 Thread Glauber de Oliveira Costa
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Avi Kivity escreveu: > Glauber de Oliveira Costa wrote: >> This is the host part of kvm clocksource implementation. As it does >> not include clockevents, it is a fairly simple implementation. We >> only have to register a per-vcpu area, and start writ

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2007-11-12 Thread Dong, Eddie
> +static void kvm_write_guest_time(struct kvm_vcpu *vcpu) +{ > + struct timespec ts; > + int r; > + > + if (!vcpu->clock_gpa) > + return; > + > + /* Updates version to the next odd number, indicating > we're writing */ > + vcpu->hv_clock.version++; > + kvm_writ

Re: [kvm-devel] [PATCH 2/3] kvmclock - the host part.

2007-11-11 Thread Avi Kivity
Glauber de Oliveira Costa wrote: > This is the host part of kvm clocksource implementation. As it does > not include clockevents, it is a fairly simple implementation. We > only have to register a per-vcpu area, and start writting to it periodically. > > Missing live migration support (a way f

[kvm-devel] [PATCH 2/3] kvmclock - the host part.

2007-11-08 Thread Glauber de Oliveira Costa
This is the host part of kvm clocksource implementation. As it does not include clockevents, it is a fairly simple implementation. We only have to register a per-vcpu area, and start writting to it periodically. Signed-off-by: Glauber de Oliveira Costa <[EMAIL PROTECTED]> --- drivers/kvm/kvm_main

Re: [kvm-devel] [PATCH 2/3] Put the virtio under the virtualization menu

2007-11-07 Thread Avi Kivity
Anthony Liguori wrote: > This patch moves virtio under the virtualization menu and changes virtio > devices to not claim to only be for lguest. > Perhaps the virt menu needs to be split into a host-side support menu and guest-side support menu. -- Do not meddle in the internals of kernels, fo

[kvm-devel] [PATCH 2/3] Put the virtio under the virtualization menu

2007-11-07 Thread Anthony Liguori
This patch moves virtio under the virtualization menu and changes virtio devices to not claim to only be for lguest. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/drivers/Kconfig b/drivers/Kconfig index f4076d9..d945ffc 100644 --- a/drivers/Kconfig +++ b/drivers/Kconfig @@ -93,6

Re: [kvm-devel] [PATCH 2/3] Split kvmctl for architectures

2007-10-18 Thread Jerone Young
On Thu, 2007-10-18 at 22:47 +0200, Izik Eidus wrote: > Jerone Young wrote: > > diff --git a/user/kvmctl-powerpc.c b/user/kvmctl-powerpc.c > > new file mode 100644 > > --- /dev/null > > +++ b/user/kvmctl-powerpc.c > > @@ -0,0 +1,351 @@ > > +/* > > + * This program is free software; you can redistri

Re: [kvm-devel] [PATCH 2/3] Split kvmctl for architectures

2007-10-18 Thread Izik Eidus
Jerone Young wrote: > diff --git a/user/kvmctl-powerpc.c b/user/kvmctl-powerpc.c > new file mode 100644 > --- /dev/null > +++ b/user/kvmctl-powerpc.c > @@ -0,0 +1,351 @@ > +/* > + * This program is free software; you can redistribute it and/or modify > + * it under the terms of the GNU General Publ

Re: [kvm-devel] [PATCH 2/3] Split kvmctl for architectures

2007-10-18 Thread Jerone Young
On Thu, 2007-10-18 at 15:28 -0500, Anthony Liguori wrote: > Jerone Young wrote: > > This patch splits kvmctl architecture specific declarations & > > implementations into their own files & headers. Common interfaces are > > kept in kvmctl.h, as well as the arch specific headers are included from >

Re: [kvm-devel] [PATCH 2/3] Split kvmctl for architectures

2007-10-18 Thread Anthony Liguori
Jerone Young wrote: > This patch splits kvmctl architecture specific declarations & > implementations into their own files & headers. Common interfaces are > kept in kvmctl.h, as well as the arch specific headers are included from > within kvmctl.h. This may or may not want to be changed. > > Also

Re: [kvm-devel] [Patch][2/3]

2007-10-11 Thread Zhang, Xiantao
+2478,7 @@ static void __init vmx_check_processor_compat(void *rtn) } } -static struct kvm_x86_ops vmx_x86_ops = { +static struct kvm_ops vmx_x86_ops = { .cpu_has_kvm_support = cpu_has_kvm_support, .disabled_by_bios = vmx_disabled_by_bios, .hardware_setup = hardwa

[kvm-devel] [Patch][2/3]

2007-10-11 Thread Zhang, Xiantao
>From cdbc4c54cf65e46e5545fe44c9a31ae457385ee0 Mon Sep 17 00:00:00 2001 From: Zhang xiantao <[EMAIL PROTECTED]> Date: Thu, 11 Oct 2007 16:42:46 +0800 In order to adapt different architectures, we have to change it to an neutral name. kvm_ops maybe not the best name, but shouldn't introduce differe

[kvm-devel] [PATCH 2/3] Allow memory to be specified in kvmctl (v2)

2007-10-10 Thread Anthony Liguori
This patch adds a --memory option to kvmctl to allow the memory size of the guest to be specified. Since v1, I added more checks for bad input as suggested by Muli. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/user/main.c b/user/main.c index 9a57a24..a08e0a7 100644 --- a/user/

[kvm-devel] [PATCH 2/3] Hoist kvm_create_lapic() into kvm_vcpu_init()

2007-10-07 Thread Rusty Russell
Move kvm_create_lapic() into kvm_vcpu_init(), rather than having svm and vmx do it. And make it return the error rather than a fairly random -ENOMEM. This also solves the problem that neither svm.c nor vmx.c actually handles the error path properly. Signed-off-by: Rusty Russell <[EMAIL PROTECTED

Re: [kvm-devel] [PATCH 2/3] virtio ring implementation

2007-09-26 Thread Dor Laor
Rusty Russell wrote: > On Tue, 2007-09-25 at 19:15 +0200, Dor Laor wrote: > >> At the moment it's not good enough, there is a potential race were the >> guest optimistically turn off >> the VRING_AVAIL_F_NO_INTERRUPT in the vring_restart and afterwards >> finds there are more_used so >> it consu

Re: [kvm-devel] [PATCH 2/3] virtio ring implementation

2007-09-25 Thread Rusty Russell
On Tue, 2007-09-25 at 19:15 +0200, Dor Laor wrote: > At the moment it's not good enough, there is a potential race were the > guest optimistically turn off > the VRING_AVAIL_F_NO_INTERRUPT in the vring_restart and afterwards > finds there are more_used so > it consume them in the poll function. >

Re: [kvm-devel] [PATCH 2/3] virtio ring implementation

2007-09-25 Thread Dor Laor
Rusty Russell wrote: On Mon, 2007-09-24 at 15:44 +0200, Dor Laor wrote: > Rusty Russell wrote: > > +irqreturn_t vring_interrupt(int irq, void *_vq) > > +{ > > + struct vring_virtqueue *vq = to_vvq(_vq); > > + > > + pr_debug("virtqueue interrupt for %p\n", vq); > > + > > + if (u

Re: [kvm-devel] [PATCH 2/3] virtio ring implementation

2007-09-25 Thread Rusty Russell
On Mon, 2007-09-24 at 15:44 +0200, Dor Laor wrote: > Rusty Russell wrote: > > +irqreturn_t vring_interrupt(int irq, void *_vq) > > +{ > > + struct vring_virtqueue *vq = to_vvq(_vq); > > + > > + pr_debug("virtqueue interrupt for %p\n", vq); > > + > > + if (unlikely(vq->broken)) >

Re: [kvm-devel] [PATCH 2/3] virtio ring implementation

2007-09-24 Thread Rusty Russell
On Mon, 2007-09-24 at 15:44 +0200, Dor Laor wrote: > Seems like there is a problem with shared irq line, the interrupt > handler always returns IRQ_HANDLED (except for the trivial case > were the callback is null). > > It can be solved by having a host irq counter (in the shared ring) and > a guest

Re: [kvm-devel] [PATCH 2/3] virtio ring implementation

2007-09-24 Thread Dor Laor
Rusty Russell wrote: These helper routines supply most of the virtqueue_ops for hypervisors which want to use a ring for virtio. Unlike the previous lguest implementation: 1) The rings are variable sized (2^n-1 elements). 2) They have an unfortunate limit of 65535 bytes per sg element. 3) The

[kvm-devel] [PATCH 2/3] virtio ring implementation

2007-09-24 Thread Rusty Russell
These helper routines supply most of the virtqueue_ops for hypervisors which want to use a ring for virtio. Unlike the previous lguest implementation: 1) The rings are variable sized (2^n-1 elements). 2) They have an unfortunate limit of 65535 bytes per sg element. 3) The page numbers are always

[kvm-devel] [PATCH 2/3] remove _eflags and use directly ctxt->eflags.

2007-09-24 Thread Laurent Vivier
Remove _eflags and use directly ctxt->eflags. Caching eflags is not needed as it is restored to vcpu by kvm_main.c:emulate_instruction() from ctxt->eflags only if emulation doesn't fail. Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]> --- drivers/kvm/x86_emulate.c | 121 +

[kvm-devel] [PATCH 2/3] remove _eflags and use directly ctxt->eflags.

2007-09-21 Thread Laurent Vivier
Remove _eflags and use directly ctxt->eflags. Caching eflags is not needed as it is restored to vcpu by kvm_main.c:emulate_instruction() from ctxt->eflags only if emulation doesn't fail Signed-off-by: Laurent Vivier <[EMAIL PROTECTED]> --- drivers/kvm/x86_emulate.c | 120 +

Re: [kvm-devel] [PATCH 2/3] Refactor hypercall infrastructure (v3)

2007-09-18 Thread Anthony Liguori
Avi Kivity wrote: > Avi Kivity wrote: > >> Avi Kivity wrote: >> >>> Anthony Liguori wrote: >>> >>> This patch refactors the current hypercall infrastructure to better support live migration and SMP. It eliminates the hypercall page by trapping the UD exception

Re: [kvm-devel] [PATCH 2/3] Refactor hypercall infrastructure (v3)

2007-09-18 Thread Avi Kivity
Avi Kivity wrote: > Avi Kivity wrote: >> Anthony Liguori wrote: >> >>> This patch refactors the current hypercall infrastructure to better >>> support live >>> migration and SMP. It eliminates the hypercall page by trapping the UD >>> exception that would occur if you used the wrong hypercall

Re: [kvm-devel] [PATCH 2/3] Refactor hypercall infrastructure (v3)

2007-09-18 Thread Avi Kivity
Avi Kivity wrote: > Anthony Liguori wrote: > >> This patch refactors the current hypercall infrastructure to better support >> live >> migration and SMP. It eliminates the hypercall page by trapping the UD >> exception that would occur if you used the wrong hypercall instruction for >> the >>

Re: [kvm-devel] [PATCH 2/3] Refactor hypercall infrastructure (v3)

2007-09-18 Thread Avi Kivity
Anthony Liguori wrote: > This patch refactors the current hypercall infrastructure to better support > live > migration and SMP. It eliminates the hypercall page by trapping the UD > exception that would occur if you used the wrong hypercall instruction for the > underlying architecture and repla

[kvm-devel] [PATCH 2/3] Refactor hypercall infrastructure (v3)

2007-09-17 Thread Anthony Liguori
This patch refactors the current hypercall infrastructure to better support live migration and SMP. It eliminates the hypercall page by trapping the UD exception that would occur if you used the wrong hypercall instruction for the underlying architecture and replacing it with the right one lazily.

Re: [kvm-devel] [PATCH 2/3] Refactor hypercall infrastructure (v3)

2007-09-17 Thread Nakajima, Jun
Anthony Liguori wrote: > This patch refactors the current hypercall infrastructure to better support > live > migration and SMP. It eliminates the hypercall page by trapping the UD > exception that would occur if you used the wrong hypercall instruction for the > underlying architecture and repla

Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration wheninactive

2007-09-10 Thread He, Qing
PROTECTED]> >-Original Message- >From: Avi Kivity [mailto:[EMAIL PROTECTED] >Sent: 2007年9月10日 15:27 >To: He, Qing >Cc: kvm-devel@lists.sourceforge.net >Subject: Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration >wheninactive > >He, Qing wrote: >> resended,

Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration wheninactive

2007-09-10 Thread Avi Kivity
gt;> To: Avi Kivity >> Cc: kvm-devel@lists.sourceforge.net >> Subject: Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration >> wheninactive >> >> Avi, >> This is the updated patch, which avoids inactive hrtimers from >> unintended >&

Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration wheninactive

2007-09-09 Thread He, Qing
resended, due to wrong attachment >-Original Message- >From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED] On Behalf Of He, Qing >Sent: 2007年9月10日 13:59 >To: Avi Kivity >Cc: kvm-devel@lists.sourceforge.net >Subject: Re: [kvm-devel] [PATCH 2/3] KVM: fix apic

Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration when inactive

2007-09-09 Thread He, Qing
BIOS time, maybe we can defer it to some later time >-Original Message- >From: Avi Kivity [mailto:[EMAIL PROTECTED] >Sent: 2007年9月9日 15:39 >To: He, Qing >Cc: kvm-devel@lists.sourceforge.net >Subject: Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration when >

Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration when inactive

2007-09-09 Thread Avi Kivity
He, Qing wrote: > +if (atomic_read(&apic->timer.active)) >>> Or here? >>> >>> +hrtimer_start(timer, timer->expires, + HRTIMER_MODE_ABS); } EXPORT_SYMBOL_GPL(kvm_migrate_apic_timer); >> I think

Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration when inactive

2007-09-06 Thread He, Qing
>-Original Message- >From: Avi Kivity [mailto:[EMAIL PROTECTED] >Sent: 2007年9月6日 17:47 >To: He, Qing >Cc: kvm-devel@lists.sourceforge.net >Subject: Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration when >inactive > >Avi Kivity wrote: >>

Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration when inactive

2007-09-06 Thread Avi Kivity
He, Qing wrote: > > When local apic timer is inactive or is expired in oneshot mode, it > should not be restarted in save/restore or hrtimer migration. This > patch fixes this. > > diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h > index 5f97e25..68d454c 100644 > --- a/drivers/kv

Re: [kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration when inactive

2007-09-06 Thread Avi Kivity
Avi Kivity wrote: > He, Qing wrote: >> When local apic timer is inactive or is expired in oneshot >> mode, it >> should not be restarted in save/restore or hrtimer migration. This >> patch fixes this. >> >> diff --git a/drivers/kvm/irq.h b/drivers/kvm/irq.h >> index 5f97e25..68d454

[kvm-devel] [PATCH 2/3] KVM: fix apic timer save/migration when inactive

2007-09-06 Thread He, Qing
When local apic timer is inactive or is expired in oneshot mode, it should not be restarted in save/restore or hrtimer migration. This patch fixes this. Signed-off-by: Eddie (Yaozu) Dong <[EMAIL PROTECTED]> Signed-off-by: Qing He <[EMAIL PROTECTED]> --- drivers/kvm/irq.

[kvm-devel] [PATCH 2/3] Fix option ROM loading

2007-09-05 Thread Anthony Liguori
Make sure to copy the option ROMs into physical memory so they're visible to KVM guests. With the older BIOS, this allows -boot n to work although the CVS BIOS does not work. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --git a/qemu/hw/pc.c b/qemu/hw/pc.c index a5c08bc..f2917ca 100644

Re: [kvm-devel] [PATCH 2/3] Refactor hypercall infrastructure

2007-08-28 Thread Anthony Liguori
On Wed, 2007-08-29 at 04:12 +1000, Rusty Russell wrote: > On Mon, 2007-08-27 at 10:16 -0500, Anthony Liguori wrote: > > This patch refactors the current hypercall infrastructure to better support > > live > > migration and SMP. It eliminates the hypercall page by trapping the UD > > exception tha

Re: [kvm-devel] [PATCH 2/3] Refactor hypercall infrastructure

2007-08-28 Thread Rusty Russell
On Mon, 2007-08-27 at 10:16 -0500, Anthony Liguori wrote: > This patch refactors the current hypercall infrastructure to better support > live > migration and SMP. It eliminates the hypercall page by trapping the UD > exception that would occur if you used the wrong hypercall instruction for the

[kvm-devel] [PATCH 2/3] KVM paravirt-ops implementation (v2)

2007-08-27 Thread Anthony Liguori
A very simple paravirt_ops implementation for KVM. Future patches will add more sophisticated optimizations. The goal of having this presenting this now is to validate the new hypercall infrastructure and to make my patch queue smaller. Signed-off-by: Anthony Liguori <[EMAIL PROTECTED]> diff --

Re: [kvm-devel] [PATCH 2/3] Refactor hypercall infrastructure

2007-08-27 Thread Anthony Liguori
On Mon, 2007-08-27 at 19:06 +0300, Avi Kivity wrote: > Anthony Liguori wrote: > > void kvm_emulate_cpuid(struct kvm_vcpu *vcpu) > > { > > int i; > > @@ -1632,6 +1575,12 @@ void kvm_emulate_cpuid(struct kvm_vcpu *vcpu) > > vcpu->regs[VCPU_REGS_RBX] = 0; > > vcpu->regs[VCPU_REGS_RCX] =

[kvm-devel] [PATCH 2/3] Refactor hypercall infrastructure

2007-08-27 Thread Anthony Liguori
This patch refactors the current hypercall infrastructure to better support live migration and SMP. It eliminates the hypercall page by trapping the UD exception that would occur if you used the wrong hypercall instruction for the underlying architecture and replacing it with the right one lazily.

Re: [kvm-devel] [PATCH 2/3] Refactor hypercall infrastructure

2007-08-27 Thread Avi Kivity
Anthony Liguori wrote: > This patch refactors the current hypercall infrastructure to better support > live > migration and SMP. It eliminates the hypercall page by trapping the UD > exception that would occur if you used the wrong hypercall instruction for the > underlying architecture and repla

Re: [kvm-devel] [PATCH 2/3] Architecture independence layer - v0 - basic mechanism

2007-08-22 Thread Avi Kivity
Christian Ehrhardt wrote: > [Patch 2/3] > This introduces the Kconfig & Makefile changes as well as creating the > still empty body of kvm_x86.* > > Related part from the 0/3 mail: > - Since architecture will not change at runtime I do not use a > arch_ops structure > - Instead I used a hidden Kc

  1   2   >