Re: [PATCH] KVM: MMU: Disassociate direct maps from guest levels

2010-03-23 Thread Marcelo Tosatti
On Tue, Mar 23, 2010 at 01:02:35PM +0200, Avi Kivity wrote: On 03/23/2010 12:51 PM, Avi Kivity wrote: On 03/17/2010 08:16 PM, Marcelo Tosatti wrote: On Sun, Mar 14, 2010 at 10:22:52AM +0200, Avi Kivity wrote: Direct maps are linear translations for a section of memory, used for real mode

Re: [PATCH v3] KVM MMU: check reserved bits only if CR4.PSE=1 or CR4.PAE=1

2010-03-23 Thread Marcelo Tosatti
On Fri, Mar 19, 2010 at 05:58:53PM +0800, Xiao Guangrong wrote: - Check reserved bits only if CR4.PAE=1 or CR4.PSE=1 when guest #PF occurs - Fix a typo in reset_rsvds_bits_mask() Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Reviewed-by: Marcelo Tosatti mtosa...@redhat.com

[patch 5/6] kvm: init mp_state

2010-03-23 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-uq/target-i386/kvm.c === --- qemu-uq.orig/target-i386/kvm.c +++ qemu-uq/target-i386/kvm.c @@ -279,6 +279,12 @@ void kvm_arch_reset_vcpu(CPUState *env) env

[patch 2/6] kvm: handle internal error

2010-03-23 Thread Marcelo Tosatti
Port qemu-kvm's KVM_EXIT_INTERNAL_ERROR handling to upstream. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-uq/kvm-all.c === --- qemu-uq.orig/kvm-all.c +++ qemu-uq/kvm-all.c @@ -721,6 +721,32 @@ static int

[patch 4/6] kvm_init_vcpu requires global lock held

2010-03-23 Thread Marcelo Tosatti
Since it accesses data protected by the lock. Index: qemu-uq/vl.c === --- qemu-uq.orig/vl.c +++ qemu-uq/vl.c @@ -2447,6 +2447,7 @@ static void *kvm_cpu_thread_fn(void *arg { CPUState *env = arg; +

[patch 1/6] target-i386: print EFER in cpu_dump_state

2010-03-23 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-uq/target-i386/helper.c === --- qemu-uq.orig/target-i386/helper.c +++ qemu-uq/target-i386/helper.c @@ -355,6 +355,7 @@ void cpu_dump_state(CPUState *env, FILE

[patch 6/6] kvm: remove explicit kvm_arch_reset_vcpu from kvm_init_vcpu

2010-03-23 Thread Marcelo Tosatti
This is now done via the initialization's qemu_system_reset call. Index: qemu-uq/kvm-all.c === --- qemu-uq.orig/kvm-all.c +++ qemu-uq/kvm-all.c @@ -209,7 +209,6 @@ int kvm_init_vcpu(CPUState *env) ret = kvm_arch_init_vcpu(env);

[patch 0/6] misc uq/master updates (v2)

2010-03-23 Thread Marcelo Tosatti
See individual patches for details. -- 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

[patch 3/6] remove unused bios_mem variable

2010-03-23 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm-cleanups/cpu-all.h === --- qemu-kvm-cleanups.orig/cpu-all.h +++ qemu-kvm-cleanups/cpu-all.h @@ -846,7 +846,6 @@ extern int phys_ram_fd; extern uint8_t

[patch 0/6] misc qemu-kvm cleanups

2010-03-23 Thread Marcelo Tosatti
See individual patches for details. -- 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

[patch 5/6] qemu-kvm: remove unused qemu_kvm_get_dirty_pages

2010-03-23 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm-cleanups/qemu-kvm.c === --- qemu-kvm-cleanups.orig/qemu-kvm.c +++ qemu-kvm-cleanups/qemu-kvm.c @@ -2349,11 +2349,6 @@ int kvm_set_irq(int irq, int level, int

[patch 2/6] make cpu_physical_memory_set_dirty_tracking equal to upstream

2010-03-23 Thread Marcelo Tosatti
Probably introduced by mismerge. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm-cleanups/exec.c === --- qemu-kvm-cleanups.orig/exec.c +++ qemu-kvm-cleanups/exec.c @@ -2003,7 +2003,7 @@ void

[patch 1/6] remove kvm_update_dirty_pages_log call from ram_save_block

2010-03-23 Thread Marcelo Tosatti
There is no need to update the dirty log from inside ram_save_block, since this happens through cpu_physical_sync_dirty_bitmap. In stage 3, where the VM is stopped, cpu_physical_sync_dirty_bitmap guarantees dirty log is synchronized before migration finishes. Signed-off-by: Marcelo Tosatti

[patch 6/6] qemu-kvm: use reset handler for vcpus

2010-03-23 Thread Marcelo Tosatti
Hook into the reset handlers instead of using custom code in qemu_kvm_system_reset. Also move kvm_arch_init_vcpu to kvm_create_vcpu. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm-cleanups/qemu-kvm.c

[patch 4/6] qemu-kvm: use upstream kvm_flush_coalesced_mmio_buffer

2010-03-23 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm-cleanups/qemu-kvm.c === --- qemu-kvm-cleanups.orig/qemu-kvm.c +++ qemu-kvm-cleanups/qemu-kvm.c @@ -935,19 +935,7 @@ int kvm_run(CPUState *env) post_kvm_run(kvm

KVM: x86: document KVM_REQ_PENDING_TIMER usage

2010-03-23 Thread Marcelo Tosatti
Document that KVM_REQ_PENDING_TIMER is implicitly used during guest entry. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/arch/x86/kvm/timer.c b/arch/x86/kvm/timer.c index eea4043..9805f05 100644 --- a/arch/x86/kvm/timer.c +++ b/arch/x86/kvm/timer.c @@ -12,7 +12,8 @@ static int

Re: Strange CPU usage pattern in SMP guest

2010-03-23 Thread Marcelo Tosatti
Tested-by: Marcelo Tosatti mtosa...@redhat.com Cc: kvm@vger.kernel.org diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 4759917..2e1064f 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h @@ -164,10 +164,11 @@ struct hrtimer_clock_base { * @expires_next

Re: KVM: x86: document KVM_REQ_PENDING_TIMER usage

2010-03-24 Thread Marcelo Tosatti
On Wed, Mar 24, 2010 at 09:10:54AM +0800, 王箫 wrote: Thanks for pointing that, but is it possible that explicitly check the pending timer with kvm_cpu_has_pending_timer() in vcpu_enter_guest()? There seems some function duplication between KVM_REQ_PENDING_TIMER and ktimer-pending. Right.

[patch 8/8] test: long rmap chains

2010-03-24 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm/kvm/user/config-x86-common.mak === --- qemu-kvm.orig/kvm/user/config-x86-common.mak +++ qemu-kvm/kvm/user/config-x86-common.mak @@ -45,6 +45,9 @@ $(TEST_DIR

[patch 4/8] test: export vm helpers

2010-03-24 Thread Marcelo Tosatti
To be used by next patches. Also make install_pte take an argument indicating physical location of pagetable. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm/kvm/user/test/x86/vm.c === --- qemu-kvm.orig/kvm/user

[patch 7/8] test: bump max vcpus to 64

2010-03-24 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm/kvm/user/test/x86/cstart64.S === --- qemu-kvm.orig/kvm/user/test/x86/cstart64.S +++ qemu-kvm/kvm/user/test/x86/cstart64.S @@ -6,7 +6,7 @@ boot_idt = 0 ipi_vector

[patch 6/8] test: parallel faults vs slot deletion

2010-03-24 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm/kvm/user/config-x86-common.mak === --- qemu-kvm.orig/kvm/user/config-x86-common.mak +++ qemu-kvm/kvm/user/config-x86-common.mak @@ -42,6 +42,9 @@ $(TEST_DIR

[patch 1/8] test: allow functions to execute on non-irq context remotely

2010-03-24 Thread Marcelo Tosatti
Which allows code to execute on remote cpus while receiving interrupts. Also move late smp initialization to common code, and the smp loop to C code. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm/kvm/user/test/lib/x86/smp.c

[patch 2/8] test: add pagefault exception handler

2010-03-24 Thread Marcelo Tosatti
Which print cr2 and exits. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm/kvm/user/test/lib/x86/smp.c === --- qemu-kvm.orig/kvm/user/test/lib/x86/smp.c +++ qemu-kvm/kvm/user/test/lib/x86/smp.c @@ -5,6 +5,7

[patch 0/8] add slot deletion, rmap chain tests

2010-03-24 Thread Marcelo Tosatti
-- 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

[patch 3/8] test: protect fwcfg accesses with lock

2010-03-24 Thread Marcelo Tosatti
So multiple CPU's can access fwcfg safely. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm/kvm/user/test/lib/x86/fwcfg.c === --- qemu-kvm.orig/kvm/user/test/lib/x86/fwcfg.c +++ qemu-kvm/kvm/user/test/lib/x86

[patch 5/8] testdev: add port to create/delete memslots

2010-03-24 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm/hw/testdev.c === --- qemu-kvm.orig/hw/testdev.c +++ qemu-kvm/hw/testdev.c @@ -5,6 +5,10 @@ struct testdev { ISADevice dev; CharDriverState *chr

Re: [patch 1/8] test: allow functions to execute on non-irq context remotely

2010-03-25 Thread Marcelo Tosatti
On Thu, Mar 25, 2010 at 06:25:56PM +0200, Avi Kivity wrote: On 03/24/2010 11:24 PM, Marcelo Tosatti wrote: Which allows code to execute on remote cpus while receiving interrupts. Also move late smp initialization to common code, and the smp loop to C code. + +void smp_loop(void

Re: [PATCH 2/2] KVM: Trace emulated instructions

2010-04-05 Thread Marcelo Tosatti
On Thu, Mar 25, 2010 at 05:02:56PM +0200, Avi Kivity wrote: Log emulated instructions in ftrace, especially if they failed. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/trace.h | 86 ++ arch/x86/kvm/x86.c |4 ++ 2

Re: [PATCH] fix migration with big mem guests

2010-04-05 Thread Marcelo Tosatti
On Mon, Apr 05, 2010 at 02:26:37AM +0300, Izik Eidus wrote: Hi, (Below is explenation about the bug to who does`nt familier) In the beggining I tried to make this code run with qemu_bh() but the result was performence catastrophic The reason is that the migration code just doesn`t built

Re: [PATCH 1/2] KVM MMU: cleanup/fix mmu audit code

2010-04-05 Thread Marcelo Tosatti
On Thu, Apr 01, 2010 at 04:50:45PM +0800, Xiao Guangrong wrote: This patch does: - 'sp' parameter in inspect_spte_fn() is not used, so remove it - fix 'kvm' and 'slots' is not defined in count_rmaps() - fix a bug in inspect_spte_has_rmap() Signed-off-by: Xiao Guangrong

Re: qemu-kvm.git stable requests

2010-04-05 Thread Marcelo Tosatti
On Thu, Apr 01, 2010 at 06:25:58PM +0300, Avi Kivity wrote: On 03/31/2010 11:26 AM, Alexander Graf wrote: Howdy, Apparently there was just the very first case of someone requiring my patch to enable BAR regions 4k. To enable people to use those devices with a released version, I'd

Re: [PATCH 2/2] KVM: Trace emulated instructions

2010-04-06 Thread Marcelo Tosatti
On Tue, Apr 06, 2010 at 12:38:00AM +0300, Avi Kivity wrote: On 04/05/2010 09:44 PM, Marcelo Tosatti wrote: On Thu, Mar 25, 2010 at 05:02:56PM +0200, Avi Kivity wrote: Log emulated instructions in ftrace, especially if they failed. Why not log all emulated instructions? Seems useful to me

Re: [PATCHv6 0/4] qemu-kvm: vhost net port

2010-04-06 Thread Marcelo Tosatti
On Sun, Apr 04, 2010 at 07:30:20PM +0300, Avi Kivity wrote: On 04/04/2010 02:46 PM, Michael S. Tsirkin wrote: On Wed, Mar 24, 2010 at 02:38:57PM +0200, Avi Kivity wrote: On 03/17/2010 03:04 PM, Michael S. Tsirkin wrote: This is port of vhost v6 patch set I posted previously to qemu-kvm, for

Re: [PATCH 1/2] KVM MMU: remove unused field

2010-04-07 Thread Marcelo Tosatti
On Tue, Apr 06, 2010 at 06:29:05PM +0800, Xiao Guangrong wrote: kvm_mmu_page.oos_link is not used, so remove it Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/include/asm/kvm_host.h |2 -- arch/x86/kvm/mmu.c |1 - 2 files changed, 0

Re: [PATCH] [PPC] Add dequeue for external on BookE

2010-04-07 Thread Marcelo Tosatti
On Wed, Apr 07, 2010 at 10:03:25AM +0200, Alexander Graf wrote: Commit a0abee86af2d1f048dbe99d2bcc4a2cefe685617 introduced unsetting of the IRQ line from userspace. This added a new core specific callback that I apparently forgot to add for BookE. So let's add the callback for BookE as well,

VMX and save/restore guest in virtual-8086 mode

2010-04-07 Thread Marcelo Tosatti
During initialization, WinXP.32 switches to virtual-8086 mode, with paging enabled, to use VGABIOS functions. Since enter_pmode unconditionally clears IOPL and VM bits in RFLAGS flags = vmcs_readl(GUEST_RFLAGS); flags = ~(X86_EFLAGS_IOPL | X86_EFLAGS_VM); flags |=

Re: VMX and save/restore guest in virtual-8086 mode

2010-04-08 Thread Marcelo Tosatti
On Thu, Apr 08, 2010 at 11:05:56AM +0300, Avi Kivity wrote: On 04/08/2010 10:54 AM, Jan Kiszka wrote: Looks like KVM_SET_REGS should write rmode.save_iopl (and a new save_vm)? Just like we manipulate the flags for guest debugging in the set/get_rflags vendor handlers, the same should

Re: VMX and save/restore guest in virtual-8086 mode

2010-04-08 Thread Marcelo Tosatti
On Thu, Apr 08, 2010 at 09:54:35AM +0200, Jan Kiszka wrote: The following patch fixes it, but it has some drawbacks: - cpu_synchronize_state+writeback is noticeably slow with tpr patching, this makes it slower. Isn't it a very rare event? It has to be -

Re: [PATCH UNTESTED] KVM: VMX: Save/restore rflags.vm correctly in real mode

2010-04-08 Thread Marcelo Tosatti
On Thu, Apr 08, 2010 at 06:19:35PM +0300, Avi Kivity wrote: Currently we set eflags.vm unconditionally when entering real mode emulation through virtual-8086 mode, and clear it unconditionally when we enter protected mode. The means that the following sequence KVM_SET_REGS

Re: latest git - main thread spinning

2010-04-12 Thread Marcelo Tosatti
On Sun, Apr 11, 2010 at 09:27:32PM -0600, David S. Ahern wrote: With the latest qemu-kvm.git (fresh pull today, 11-April-2010) the main qemu thread is spinning. It looks like the recent sync with qemu.git is the culprit -- specifically, d6f4ade214a9f74dca9495b83a24ff9c113e4f9a from Paolo on

Re: [PATCH v2 0/2] Trace emulated instrucions

2010-04-12 Thread Marcelo Tosatti
On Sun, Apr 11, 2010 at 01:05:14PM +0300, Avi Kivity wrote: Add a trace of instruction emulation into ftrace. This can help analyze performance issues, or, in the case of failed emulation, identify the missing instructions. v2: - trace all emulation starts - add missing statistic

Re: [PATCH 3/6] KVM MMU: optimize/cleanup for marking parent unsync

2010-04-12 Thread Marcelo Tosatti
On Mon, Apr 12, 2010 at 04:02:24PM +0800, Xiao Guangrong wrote: - 'vcpu' is not used while mark parent unsync, so remove it - if it has alread marked unsync, no need to walk it's parent Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com Xiao, Did you actually see this codepath as

Re: [PATCH 2/6] KVM MMU: fix kvm_mmu_zap_page() and its calling path

2010-04-12 Thread Marcelo Tosatti
On Mon, Apr 12, 2010 at 04:01:09PM +0800, Xiao Guangrong wrote: - calculate zapped page number properly in mmu_zap_unsync_children() - calculate freeed page number properly kvm_mmu_change_mmu_pages() - restart list walking if have children page zapped Signed-off-by: Xiao Guangrong

Re: [PATCH] KVM: fix the handling of dirty bitmaps to avoid overflows

2010-04-12 Thread Marcelo Tosatti
On Mon, Apr 12, 2010 at 07:35:35PM +0900, Takuya Yoshikawa wrote: This patch fixes a bug found by Avi during the review process of my dirty bitmap related work. To ppc and ia64 people: The fix is really simple but touches all architectures using dirty bitmaps. So please check this will

Re: [PATCH 3/6] KVM MMU: optimize/cleanup for marking parent unsync

2010-04-13 Thread Marcelo Tosatti
On Tue, Apr 13, 2010 at 09:53:07AM +0800, Xiao Guangrong wrote: Marcelo Tosatti wrote: Xiao, Did you actually see this codepath as being performance sensitive? Actually, i not run benchmarks to contrast the performance before this patch and after this patch. I'd prefer

Re: [PATCH 2/6] KVM MMU: fix kvm_mmu_zap_page() and its calling path

2010-04-13 Thread Marcelo Tosatti
On Tue, Apr 13, 2010 at 09:34:14AM +0800, Xiao Guangrong wrote: Marcelo Tosatti wrote: @@ -1483,8 +1483,8 @@ static int mmu_zap_unsync_children(struct kvm *kvm, for_each_sp(pages, sp, parents, i) { kvm_mmu_zap_page(kvm, sp

Re: [PATCHv2] KVM: move DR register access handling into generic code

2010-04-13 Thread Marcelo Tosatti
On Tue, Apr 13, 2010 at 10:05:23AM +0300, Gleb Natapov wrote: Currently both SVM and VMX have their own DR handling code. Move it to x86.c. Changelog: v1-v2 - kvm_set_dr() always return 1 in a case of error Signed-off-by: Gleb Natapov g...@redhat.com Applied, thanks. -- To

Re: [PATCH 3/6] KVM MMU: optimize/cleanup for marking parent unsync

2010-04-14 Thread Marcelo Tosatti
On Wed, Apr 14, 2010 at 11:23:38AM +0800, Xiao Guangrong wrote: Marcelo Tosatti wrote: I'd prefer to not touch it. This patch avoids walk all parents and i think this overload is really unnecessary. It has other tricks in this codepath but i not noticed? :-) My point

Re: [PATCH 2/6] KVM MMU: fix kvm_mmu_zap_page() and its calling path

2010-04-14 Thread Marcelo Tosatti
On Wed, Apr 14, 2010 at 10:14:29AM +0800, Xiao Guangrong wrote: Marcelo Tosatti wrote: On Tue, Apr 13, 2010 at 09:34:14AM +0800, Xiao Guangrong wrote: Marcelo Tosatti wrote: @@ -1483,8 +1483,8 @@ static int mmu_zap_unsync_children(struct kvm *kvm, for_each_sp

Re: [PATCH] qemu-kvm: emulator tests: fix msr test

2010-04-14 Thread Marcelo Tosatti
On Tue, Apr 13, 2010 at 05:26:47PM +0300, Naphtali Sprei wrote: use correct 64 bit mode inline assembly constraints use a canonical form address when writing to the MSR_KERNEL_GS_BASE MSR Signed-off-by: Naphtali Sprei nsp...@redhat.com Applied, thanks. -- To unsubscribe from this list:

Re: [PATCH] get rid of mmu_only parameter in emulator_write_emulated()

2010-04-14 Thread Marcelo Tosatti
On Tue, Apr 13, 2010 at 10:21:56AM +0300, Gleb Natapov wrote: May be I am missing something here, but it seams we can call kvm_mmu_pte_write() directly from emulator_cmpxchg_emulated() instead of passing mmu_only down to emulator_write_emulated_onepage() and call it there. Signed-off-by:

Re: [PATCH] KVM: cleanup: limit the number of pages per memory slot

2010-04-14 Thread Marcelo Tosatti
On Tue, Apr 13, 2010 at 10:47:24PM +0900, Takuya Yoshikawa wrote: This is based on my last patch: fix the handling of dirty bitmaps to avoid overflows Sorry, this resulted in reverting part of that. === This patch limits the number of pages per memory slot to make us free from extra

Re: [PATCH] KVM: MMU: Replace role.glevels with role.cr4_pae

2010-04-14 Thread Marcelo Tosatti
On Wed, Apr 14, 2010 at 07:32:12PM +0300, Avi Kivity wrote: On 04/14/2010 07:20 PM, Avi Kivity wrote: There is no real distinction between glevels=3 and glevels=4; both have exactly the same format and the code is treated exactly the same way. Drop role.glevels and replace is with

Re: [PATCHv2] KVM: prevent spurious exit to userspace during task switch emulation.

2010-04-15 Thread Marcelo Tosatti
On Thu, Apr 15, 2010 at 01:09:05PM +0300, Gleb Natapov wrote: If kvm_task_switch() fails code exits to userspace without specifying exit reason, so the previous exit reason is reused by userspace. Fix this by specifying exit reason correctly. --- Changelog: v1-v2: - report

Re: [PATCH] KVM: MMU: Replace role.glevels with role.cr4_pae

2010-04-15 Thread Marcelo Tosatti
On Wed, Apr 14, 2010 at 07:20:03PM +0300, Avi Kivity wrote: There is no real distinction between glevels=3 and glevels=4; both have exactly the same format and the code is treated exactly the same way. Drop role.glevels and replace is with role.cr4_pae (which is meaningful). This simplifies

Re: [PATCH] kvm test: Add 32-bit task switch micro-test

2010-04-15 Thread Marcelo Tosatti
On Wed, Apr 14, 2010 at 04:12:46PM +0200, Jan Kiszka wrote: This implements a basic task switch test for 32-bit targets. It specifically stresses the case that a fault with attached error code triggers the switch via a task gate. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Applied,

Re: [PATCH v2 2/2] KVM: x86: Push potential exception error code on task switches

2010-04-15 Thread Marcelo Tosatti
On Wed, Apr 14, 2010 at 03:51:09PM +0200, Jan Kiszka wrote: When a fault triggers a task switch, the error code, if existent, has to be pushed on the new task's stack. Implement the missing bits. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- Changes in v2: - push writeback into

Re: [PATCH v2 2/5] KVM MMU: fix kvm_mmu_zap_page() and its calling path

2010-04-15 Thread Marcelo Tosatti
On Fri, Apr 16, 2010 at 09:25:03PM +0800, Xiao Guangrong wrote: - calculate zapped page number properly in mmu_zap_unsync_children() - calculate freeed page number properly kvm_mmu_change_mmu_pages() Signed-off-by: Xiao Guangrong xiaoguangr...@cn.fujitsu.com --- arch/x86/kvm/mmu.c | 12

KVM autotest: add boot_savevm test

2010-04-15 Thread Marcelo Tosatti
This test boots a guest while periodically running savevm/loadvm. Adjust savevm_delay/guest memory size to reduce run time, if excessive. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: autotest/client/tests/kvm/tests/boot_savevm.py

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-04-16 Thread Marcelo Tosatti
-by: Glauber Costa glom...@redhat.com CC: Jeremy Fitzhardinge jer...@goop.org CC: Avi Kivity a...@redhat.com CC: Marcelo Tosatti mtosa...@redhat.com CC: Zachary Amsden zams...@redhat.com --- arch/x86/kernel/pvclock.c | 23 +++ 1 files changed, 23 insertions(+), 0 deletions

stable tag on kvm patches

2010-04-16 Thread Marcelo Tosatti
To have better testing over -stable kernel KVM Avi decided to drop the Cc: sta...@kernel.org tag (which meant such patches are included directly in the process by Greg), to instead queue patches in kvm-updates/2.6.3x branches and autotest them before submission. So to avoid automatic inclusion,

Re: [PATCH v3 1/2] KVM MMU: fix kvm_mmu_zap_page() and its calling path

2010-04-16 Thread Marcelo Tosatti
On Fri, Apr 16, 2010 at 04:34:42PM +0800, Xiao Guangrong wrote: This patch fix: - calculate zapped page number properly in mmu_zap_unsync_children() - calculate freeed page number properly kvm_mmu_change_mmu_pages() - if zapped children page it shoud restart hlist walking Signed-off-by:

Re: [PATCH] kvm x86 mmu: simplify kvm_mmu_unlink_parents()

2010-04-19 Thread Marcelo Tosatti
On Sat, Apr 17, 2010 at 04:50:13PM +0800, Lai Jiangshan wrote: mmu_page_remove_parent_pte() does much maintenance works, but kvm_mmu_unlink_parents() unlink all parents, so such maintenance works are not need. This patch simplifies the works of kvm_mmu_unlink_parents() by unlinking

Re: [BUG] kvm: dereference srcu-protected pointer without srcu_read_lock() held

2010-04-19 Thread Marcelo Tosatti
On Mon, Apr 19, 2010 at 01:08:29PM +0300, Avi Kivity wrote: On 04/19/2010 12:58 PM, Lai Jiangshan wrote: Applied the patch I just sent and let CONFIG_PROVE_RCU=y, we can got the following dmesg. And we found that it is because some codes in KVM dereferences srcu-protected pointer without

Re: [PATCH 1/5] Add a global synchronization point for pvclock

2010-04-19 Thread Marcelo Tosatti
On Mon, Apr 19, 2010 at 03:25:43PM -0300, Glauber Costa wrote: On Mon, Apr 19, 2010 at 09:19:38AM -0700, Jeremy Fitzhardinge wrote: On 04/19/2010 07:26 AM, Glauber Costa wrote: Is the problem that the tscs are starting out of sync, or that they're drifting relative to each other over

Re: [PATCH] KVM: MMU: Drop cr4.pge from shadow page role

2010-04-19 Thread Marcelo Tosatti
On Mon, Apr 19, 2010 at 05:31:49PM +0300, Avi Kivity wrote: Since commit bf47a760f66ad, we no longer handle ptes with the global bit set specially, so there is no reason to distinguish between shadow pages created with cr4.gpe set and clear. Such tracking is expensive when the guest toggles

[UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-20 Thread Marcelo Tosatti
for the KVM_DEV_IRQ_HOST_MSIX case. Other cases do not require the lock or interrupts disabled (a new work instance will be queued in case of concurrent interrupt). KVM-Stable-Tag. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com diff --git a/virt/kvm/assigned-dev.c b/virt/kvm/assigned-dev.c index

Re: [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-21 Thread Marcelo Tosatti
On Wed, Apr 21, 2010 at 11:32:49AM +0300, Avi Kivity wrote: On 04/20/2010 06:54 PM, Marcelo Tosatti wrote: The assigned device interrupt work handler calls kvm_set_irq, which can sleep, for example, waiting for the ioapic mutex, from irq disabled section. https://bugzilla.kernel.org

Re: [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-21 Thread Marcelo Tosatti
On Wed, Apr 21, 2010 at 03:48:12PM +0800, Yang, Sheng wrote: On Tuesday 20 April 2010 23:54:01 Marcelo Tosatti wrote: The assigned device interrupt work handler calls kvm_set_irq, which can sleep, for example, waiting for the ioapic mutex, from irq disabled section. https

Re: [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-21 Thread Marcelo Tosatti
On Wed, Apr 21, 2010 at 08:12:27PM +0300, Gleb Natapov wrote: On Wed, Apr 21, 2010 at 12:58:41PM -0300, Marcelo Tosatti wrote: Or could we make kvm_set_irq() atomic? Though the code path is a little long for spinlock. Yes, given the sleep-inside-RCU-protected section bug from

Re: [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-21 Thread Marcelo Tosatti
On Wed, Apr 21, 2010 at 08:58:48PM +0300, Gleb Natapov wrote: On Wed, Apr 21, 2010 at 02:37:34PM -0300, Marcelo Tosatti wrote: On Wed, Apr 21, 2010 at 08:12:27PM +0300, Gleb Natapov wrote: On Wed, Apr 21, 2010 at 12:58:41PM -0300, Marcelo Tosatti wrote: Or could we make kvm_set_irq

Re: [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-22 Thread Marcelo Tosatti
On Wed, Apr 21, 2010 at 09:38:39PM +0300, Gleb Natapov wrote: On Wed, Apr 21, 2010 at 03:29:11PM -0300, Marcelo Tosatti wrote: On Wed, Apr 21, 2010 at 08:58:48PM +0300, Gleb Natapov wrote: On Wed, Apr 21, 2010 at 02:37:34PM -0300, Marcelo Tosatti wrote: On Wed, Apr 21, 2010 at 08:12:27PM

Re: [PATCH 6/10] KVM MMU: don't write-protect if have new mapping to unsync page

2010-04-22 Thread Marcelo Tosatti
On Thu, Apr 22, 2010 at 02:13:04PM +0800, Xiao Guangrong wrote: If have new mapping to the unsync page(i.e, add a new parent), just update the page from sp-gfn but not write-protect gfn, and if need create new shadow page form sp-gfn, we should sync it Signed-off-by: Xiao Guangrong

Re: [UNTESTED] KVM: do not call kvm_set_irq from irq disabled section

2010-04-22 Thread Marcelo Tosatti
On Thu, Apr 22, 2010 at 09:11:30PM +0300, Gleb Natapov wrote: On Thu, Apr 22, 2010 at 01:40:38PM -0300, Marcelo Tosatti wrote: On Wed, Apr 21, 2010 at 09:38:39PM +0300, Gleb Natapov wrote: On Wed, Apr 21, 2010 at 03:29:11PM -0300, Marcelo Tosatti wrote: On Wed, Apr 21, 2010 at 08:58:48PM

Re: [PATCH] KVM: Document mmu

2010-04-22 Thread Marcelo Tosatti
On Wed, Apr 21, 2010 at 04:09:21PM +0300, Avi Kivity wrote: Signed-off-by: Avi Kivity a...@redhat.com --- Documentation/kvm/mmu.txt | 296 + 1 files changed, 296 insertions(+), 0 deletions(-) create mode 100644 Documentation/kvm/mmu.txt diff

[uq/master patch 1/5] vga: fix typo in length passed to kvm_log_stop

2010-04-23 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: qemu-kvm/hw/vga.c === --- qemu-kvm.orig/hw/vga.c +++ qemu-kvm/hw/vga.c @@ -1613,8 +1613,8 @@ void vga_dirty_log_stop(VGACommonState * kvm_log_stop(s-map_addr, s

[uq/master patch 0/5] prepare for qemu-kvm's usage of upstream memslot code

2010-04-23 Thread Marcelo Tosatti
-- 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: [uq/master patch 2/5] kvm: add logging count to slots

2010-04-26 Thread Marcelo Tosatti
On Sun, Apr 25, 2010 at 05:17:55PM +0300, Avi Kivity wrote: On 04/25/2010 04:57 PM, Jan Kiszka wrote: It's still a good idea. The current API assumes that there will be only one slot-based client (or that multiple clients will keep the refcount themselves). After the bytemap - multiple

Re: [PATCH] document boot option to -drive parameter

2010-04-26 Thread Marcelo Tosatti
On Fri, Apr 16, 2010 at 02:41:37PM -0600, Bruce Rogers wrote: The boot option is missing from the documentation for the -drive parameter. If there is a better way to descibe it, I'm all ears. Signed-off-by: Bruce Rogers brog...@novell.com diff --git a/qemu-options.hx b/qemu-options.hx

Re: [PATCH 1/3 v2] KVM MMU: make kvm_mmu_zap_page() return the number of zapped sp in total.

2010-04-26 Thread Marcelo Tosatti
On Fri, Apr 23, 2010 at 01:58:22PM +0800, Gui Jianfeng wrote: Currently, in kvm_mmu_change_mmu_pages(kvm, page), used_pages-- is performed after calling kvm_mmu_zap_page() in spite of that whether page is actually reclaimed. Because root sp won't be reclaimed by kvm_mmu_zap_page(). So

Re: [PATCH 2/3] KVM MMU: fix sp-unsync type error in trace event definition.

2010-04-26 Thread Marcelo Tosatti
On Thu, Apr 22, 2010 at 05:33:57PM +0800, Gui Jianfeng wrote: sp-unsync is bool now, so update trace event declaration. Signed-off-by: Gui Jianfeng guijianf...@cn.fujitsu.com --- arch/x86/kvm/mmutrace.h |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git

[PATCH 08/10] introduce leul_to_cpu

2010-04-26 Thread Marcelo Tosatti
To be used by next patch. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- bswap.h |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/bswap.h b/bswap.h index aace9b7..956f3fa 100644 --- a/bswap.h +++ b/bswap.h @@ -205,8 +205,10 @@ static inline void cpu_to_be32wu

[PATCH 04/10] kvm: allow qemu to set EPT identity mapping address

2010-04-26 Thread Marcelo Tosatti
From: Sheng Yang sh...@linux.intel.com If we use larger BIOS image than current 256KB, we would need move reserved TSS and EPT identity mapping pages. Currently TSS support this, but not EPT. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com --- target

[PATCH 06/10] kvm: remove explicit kvm_arch_reset_vcpu from kvm_init_vcpu

2010-04-26 Thread Marcelo Tosatti
This is now done via the initialization's qemu_system_reset call. Signed-off-by: Avi Kivity a...@redhat.com --- kvm-all.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index 9c8aa7d..eabb097 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -208,7 +208,6

[PATCH 09/10] kvm: port qemu-kvm's bitmap scanning

2010-04-26 Thread Marcelo Tosatti
Which is significantly faster. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- kvm-all.c | 53 + 1 files changed, 37 insertions(+), 16 deletions(-) diff --git a/kvm-all.c b/kvm-all.c index eabb097..ef45418 100644 --- a/kvm-all.c +++ b

[PATCH 01/10] KVM: x86: Add debug register saving and restoring

2010-04-26 Thread Marcelo Tosatti
From: Jan Kiszka jan.kis...@siemens.com Make use of the new KVM_GET/SET_DEBUGREGS to save/restore the x86 debug registers. Signed-off-by: Jan Kiszka jan.kis...@siemens.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- kvm-all.c | 11 ++ kvm.h |1

[PATCH 10/10] introduce qemu_ram_map

2010-04-26 Thread Marcelo Tosatti
Which allows drivers to register an mmaped region into ram block mappings. To be used by device assignment driver. CC: Cam Macdonell c...@cs.ualberta.ca Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- cpu-common.h |1 + exec.c | 28 2 files changed

[PATCH 07/10] vga: fix typo in length passed to kvm_log_stop

2010-04-26 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com --- hw/vga.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/vga.c b/hw/vga.c index 845dbcc..db72115 100644 --- a/hw/vga.c +++ b/hw/vga.c @@ -1618,8 +1618,8 @@ void vga_dirty_log_stop(VGACommonState *s

[PATCH 00/10] [PULL] qemu-kvm.git uq/master queue

2010-04-26 Thread Marcelo Tosatti
: Add debug register saving and restoring Marcelo Tosatti (8): target-i386: print EFER in cpu_dump_state kvm: handle internal error kvm_init_vcpu requires global lock held kvm: remove explicit kvm_arch_reset_vcpu from kvm_init_vcpu vga: fix typo in length passed

[PATCH 02/10] target-i386: print EFER in cpu_dump_state

2010-04-26 Thread Marcelo Tosatti
Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com --- target-i386/helper.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/target-i386/helper.c b/target-i386/helper.c index 3835835..c9508a8 100644 --- a/target-i386/helper.c +++ b

[PATCH 05/10] kvm_init_vcpu requires global lock held

2010-04-26 Thread Marcelo Tosatti
Since it accesses data protected by the lock. Signed-off-by: Avi Kivity a...@redhat.com --- cpus.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/cpus.c b/cpus.c index 8450ee4..2bf87d2 100644 --- a/cpus.c +++ b/cpus.c @@ -401,6 +401,7 @@ static void

[PATCH 03/10] kvm: handle internal error

2010-04-26 Thread Marcelo Tosatti
Port qemu-kvm's KVM_EXIT_INTERNAL_ERROR handling to upstream. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Signed-off-by: Avi Kivity a...@redhat.com --- kvm-all.c | 31 +++ 1 files changed, 31 insertions(+), 0 deletions(-) diff --git a/kvm-all.c b/kvm-all.c

Re: [PATCH 10/10] introduce qemu_ram_map

2010-04-26 Thread Marcelo Tosatti
On Mon, Apr 26, 2010 at 01:27:30PM -0500, Anthony Liguori wrote: On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: Which allows drivers to register an mmaped region into ram block mappings. To be used by device assignment driver. This doesn't make much sense to me. Do you use this like

Re: [PATCH 10/10] introduce qemu_ram_map

2010-04-26 Thread Marcelo Tosatti
On Mon, Apr 26, 2010 at 01:29:06PM -0500, Anthony Liguori wrote: On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: Which allows drivers to register an mmaped region into ram block mappings. To be used by device assignment driver. This is not kvm specific and not required by this pull request

Re: [PATCH] KVM: Document KVM_GET_MP_STATE and KVM_SET_MP_STATE

2010-04-26 Thread Marcelo Tosatti
On Sun, Apr 25, 2010 at 03:51:46PM +0300, Avi Kivity wrote: Signed-off-by: Avi Kivity a...@redhat.com --- Documentation/kvm/api.txt | 44 1 files changed, 44 insertions(+), 0 deletions(-) Applied, thanks. -- To unsubscribe from this list: send

Re: [PATCH 10/10] introduce qemu_ram_map

2010-04-26 Thread Marcelo Tosatti
On Mon, Apr 26, 2010 at 01:57:37PM -0500, Anthony Liguori wrote: On 04/26/2010 01:50 PM, Marcelo Tosatti wrote: On Mon, Apr 26, 2010 at 01:29:06PM -0500, Anthony Liguori wrote: On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: Which allows drivers to register an mmaped region into ram block

Re: [PATCH RFC] KVM MMU: fix hashing for TDP and non-paging modes

2010-04-26 Thread Marcelo Tosatti
On Thu, Apr 22, 2010 at 02:15:14PM -0700, Eric Northup wrote: I've been reading the x86's mmu.c recently and had been wondering about something. Avi's recent mmu documentation (thanks!) seems to have confirmed my understanding of how the shadow paging is supposed to be working. In TDP mode,

Re: [Qemu-devel] Re: [PATCH 10/10] introduce qemu_ram_map

2010-04-26 Thread Marcelo Tosatti
On Mon, Apr 26, 2010 at 02:20:42PM -0500, Anthony Liguori wrote: On 04/26/2010 02:14 PM, Marcelo Tosatti wrote: On Mon, Apr 26, 2010 at 01:57:37PM -0500, Anthony Liguori wrote: On 04/26/2010 01:50 PM, Marcelo Tosatti wrote: On Mon, Apr 26, 2010 at 01:29:06PM -0500, Anthony Liguori wrote

Re: [PATCH RFC] KVM MMU: fix hashing for TDP and non-paging modes

2010-04-26 Thread Marcelo Tosatti
On Mon, Apr 26, 2010 at 06:30:00PM -0300, Marcelo Tosatti wrote: @@ -2089,6 +2089,10 @@ static int mmu_alloc_roots(struct kvm_vcpu *vcpu) root_gfn = 0; if (mmu_check_root(vcpu, root_gfn)) return 1

  1   2   3   4   5   6   7   8   9   10   >