RE: [PATCH 3/8]kvm: Changing is_mmio_pfn to kvm_is_mmio_pfn, and make it common

2008-10-06 Thread Zhang, Xiantao
Commit 0d679782b0299bc6a0d01df20676fe56b2c31857 changed the use of is_mmio_pfn, so rebased this patch to latest kvm.git. Thanks Xiantao >From 485e503470ebaa7194d6878a6d0c5d149af0a501 Mon Sep 17 00:00:00 2001 From: Xiantao Zhang <[EMAIL PROTECTED]> Date: Sat, 27 Sep 2008 10:55:40 +0800 Subject: [P

Re: [Qemu-devel] [PATCH 4/4] Reallocate dma buffers in read/write path if needed

2008-10-06 Thread Avi Kivity
Ryan Harper wrote: There are two concerns with allowing the guest to alloc arbitrary amounts of memory. The first is that QEMU is not written in such a way to be robust in the face of out-of-memory conditions so if we run out of VA space, an important malloc could fail and we'd fall over.

Re: kvm-76 --std-vga problem

2008-10-06 Thread Niels Berglund
duck roaming.ath.cx> writes: > Michael Malone wrote: [snip > Glauber Costa replied: [snip] > > This is a band aid, but proves the general idea. Can you > > confirm that it fixes the problem for you ? > > When I apply glommer's abovementioned band aid patch and use -std-vga then > the problem is

[PATCH 04/17] qemu: Set mem_io_vaddr on io_read

2008-10-06 Thread Jan Kiszka
Required for read watchpoints. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- qemu/softmmu_template.h |1 + 1 file changed, 1 insertion(+) Index: b/qemu/softmmu_template.h === --- a/qemu/softmmu_template.h +++ b/qemu/softmmu_

[PATCH 1/5] KVM: VMX: Support for injecting software exceptions

2008-10-06 Thread Jan Kiszka
VMX differentiates between processor and software generated exceptions when injecting them into the guest. Extend vmx_queue_exception accordingly (and refactor related constants) so that we can use this service reliably for the new guest debugging framework. Signed-off-by: Jan Kiszka <[EMAIL PROTE

[PATCH 00/17] kvm-userspace: Fix and improve guest debugging and x86 debug registers

2008-10-06 Thread Jan Kiszka
While still waiting on the required merge of the QEMU bits in this series (sigh...), I want to provide an update of my guest debugging and x86 debug register improvement patches. First comes the kvm-userspace part, kernel bits follow in a separate series. No new features since my last posting. But

[PATCH 07/17] qemu: Switch self-modified code recompilation to next_cflags

2008-10-06 Thread Jan Kiszka
Switching tb_invalidate_phys_page_range and tb_invalidate_phys_page over to the new next_cflags scheme when self-modifying code was detected can save a few lines of code and remove arch dependency. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- qemu/exec.c | 32 --

[PATCH 12/17] qemu: Add debug exception hook

2008-10-06 Thread Jan Kiszka
This patch allows to hook into the delivery of EXCP_DEBUG so that other use beyond guest debugging becomes possible. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- qemu/cpu-exec.c | 13 + qemu/exec-all.h |4 2 files changed, 17 insertions(+) Index: b/qemu/cpu-exec.c ===

[PATCH 13/17] qemu: Introduce BP_CPU as a breakpoint type

2008-10-06 Thread Jan Kiszka
Add another breakpoint/watchpoint type to BP_GDB: BP_CPU. This type is intended for hardware-assisted break/watchpoint emulations like the x86 architecture requires. To keep the highest priority for BP_GDB breakpoints, this type is always inserted at the head of break/watchpoint lists, thus is fou

[PATCH 10/17] qemu: Improve debugging of SMP guests

2008-10-06 Thread Jan Kiszka
This patch enhances QEMU's built-in debugger for SMP guest debugging. It allows to set the debugger focus explicitly via the monitor command "cpu", and it automatically switches the focus on breakpoint hit to the reporting CPU. Furthermore, the patch propagates breakpoint and watchpoint insertions

[PATCH 11/17] qemu: Introduce BP_WATCHPOINT_HIT flag

2008-10-06 Thread Jan Kiszka
When one watchpoint is hit, others might have triggered as well. To support users of the watchpoint API which need to detect such cases, the BP_WATCHPOINT_HIT flag is introduced and maintained. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- qemu/cpu-all.h |1 + qemu/cpu-exec.c | 11

[PATCH 4/5] KVM: x86: Virtualize debug registers

2008-10-06 Thread Jan Kiszka
So far KVM only had basic x86 debug register support, once introduced to realize guest debugging that way. The guest itself was not able to use those registers. This patch now adds (almost) full support for guest self-debugging via hardware registers. It refactors the code, moving generic parts ou

[PATCH 15/17] kvm-userspace: Switch to new guest debug interface

2008-10-06 Thread Jan Kiszka
This patch switches both libkvm as well as the qemu pieces over to the new guest debug interface. It comes with full support for software-based breakpoints (via guest code modification), hardware-assisted breakpoints and watchpoints (x86-only so far). Breakpoint management is done inside qemu-kvm,

[PATCH 0/5] KVM: Fix and improve guest debugging and x86 debug registers

2008-10-06 Thread Jan Kiszka
This is the kernel part of my debugging patch series. Jan -- Siemens AG, Corporate Technology, CT SE 2 Corporate Competence Center Embedded Linux -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.ke

[PATCH 01/17] kvm-userspace: Remove old guest debugging hooks

2008-10-06 Thread Jan Kiszka
Prepare to apply the QEMU debugging series by removing the old guest debugging hooks for KVM. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- qemu/exec.c |8 qemu/qemu-kvm.c |7 +-- 2 files changed, 1 insertion(+), 14 deletions(-) Index: b/qemu/exec.c =

[PATCH 09/17] qemu: Remove premature memop TB terminations

2008-10-06 Thread Jan Kiszka
Now that we can properly restore the pc on watchpoint hits, there is no more need for prematurely terminating TBs if watchpoints are present. Remove all related bits. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- qemu/exec.c |4 qemu/target-arm/translate.c |6 --

[PATCH 02/17] qemu: Return appropriate watch message to gdb

2008-10-06 Thread Jan Kiszka
Return the appropriate type prefix (r, a, none) when reporting watchpoint hits to the gdb front-end. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- qemu/gdbstub.c | 17 +++-- 1 file changed, 15 insertions(+), 2 deletions(-) Index: b/qemu/gdbstub.c ===

[PATCH 2/5] KVM: New guest debug interface

2008-10-06 Thread Jan Kiszka
This rips out the support for KVM_DEBUG_GUEST and introduces a new IOCTL instead: KVM_SET_GUEST_DEBUG. The IOCTL payload consists of a generic part, controlling the "main switch" and the single-step feature. The arch specific part adds an x86 interface for intercepting both types of debug exception

[PATCH 3/5] KVM: VMX: Ensure interruptibility when single-stepping

2008-10-06 Thread Jan Kiszka
When single-stepping, we have to ensure that the INT1 can make it through even if the guest itself is uninterruptible due to MOV SS or STI. VMENTRY will fail otherwise. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- arch/x86/kvm/vmx.c | 10 -- 1 file changed, 8 insertions(+), 2 delet

[PATCH 16/17] kvm-userspace: Provide compat wrapper for set_debugreg

2008-10-06 Thread Jan Kiszka
Older set_debugreg macros did not allow to pass the register number as constant (without additional typcasting). Catch this as the latest kvm debug changes make use of this property. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- kernel/external-module-compat-comm.h | 10 ++ 1 file c

[PATCH 06/17] qemu: Introduce next_cflags

2008-10-06 Thread Jan Kiszka
Introduce next_cflags as part of CPUState. It controls the compile flags of the next newly generated TB. After use, it will automatically be reset to zero. This allows the caller to simply set and then forget about it, e.g. to ensure that the next, and only the next TB will contain just a single in

[PATCH 14/17] qemu: x86: Debug register emulation

2008-10-06 Thread Jan Kiszka
Built on top of previously enhanced breakpoint/watchpoint support, this patch adds full debug register emulation for the x86 architecture. Many corner cases were considered, and the result was successfully tested inside a Linux guest with gdb, but I won't be surprised if one or two scenarios still

Re: thread/core siblings info for guests

2008-10-06 Thread Gerd Hoffmann
Avi Kivity wrote: > > Not that I know of. Indeed finer control over cpuid is needed. We need > to support at least three modes: > > - default: expose some machine that is likely to be widely supported > - host: expose as much of the host cpu as we can > - managed: management application control

[PATCH 08/17] qemu: Restore pc on watchpoint hits - v3

2008-10-06 Thread Jan Kiszka
In order to provide accurate information about the triggering instruction, this patch adds the required bits to restore the pc if the access happened inside a TB. With the BP_STOP_BEFORE_ACCESS flag, the watchpoint user can control if the debug trap should be issued on or after the accessing instru

[PATCH 5/5] KVM: x86: Wire-up hardware breakpoints for guest debugging

2008-10-06 Thread Jan Kiszka
Add the remaining bits to make use of debug registers also for guest debugging, thus enabling the use of hardware breakpoints and watchpoints. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- arch/x86/kvm/svm.c |5 + arch/x86/kvm/vmx.c |5 + arch/x86/kvm/x86.c | 14

[PATCH 17/17] kvm-userspace: remove obsolete special_reload_dr7 hack

2008-10-06 Thread Jan Kiszka
Host debug registers are now properly saved and restored before/after entering the guest. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- kernel/x86/external-module-compat.h |2 -- kernel/x86/hack-module.awk |4 kernel/x86/preempt.c|6 -- 3 files ch

[PATCH 03/17] qemu: Refactor and enhance break/watchpoint API

2008-10-06 Thread Jan Kiszka
This patch prepares the QEMU cpu_watchpoint/breakpoint API to allow the succeeding enhancements this series comes with. First of all, it overcomes MAX_BREAKPOINTS/MAX_WATCHPOINTS by switching to dynamically allocated data structures that are kept in linked lists. This also allows to return a stabl

[PATCH 05/17] qemu: Respect length of watchpoints

2008-10-06 Thread Jan Kiszka
This adds length support for watchpoints. To keep things simple, only aligned watchpoints are accepted. Signed-off-by: Jan Kiszka <[EMAIL PROTECTED]> --- qemu/cpu-defs.h |2 +- qemu/exec.c | 28 ++-- 2 files changed, 19 insertions(+), 11 deletions(-) Index: b/qe

Re: KVM Management : Paused stauts

2008-10-06 Thread jd
Thanks for clarifying. So back to my original question, how do I determine (via monitor/console) if the guest is in "halted"/stop state ? /Jd --- On Sun, 10/5/08, Avi Kivity <[EMAIL PROTECTED]> wrote: > From: Avi Kivity <[EMAIL PROTECTED]> > Subject: Re: KVM Management : Paused stauts > To: [

[ kvm-Bugs-2149609 ] Booting IA32e Windows guest meets BSOD

2008-10-06 Thread SourceForge.net
Bugs item #2149609, was opened at 2008-10-06 07:25 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=893831&aid=2149609&group_id=180599 Please note that this message will contain a full copy

[PATCH] don't halt non-boot CPU if IRQ chip is in kernel

2008-10-06 Thread Gleb Natapov
Don't halt non-boot CPU if IRQ chip is in kernel. Otherwise CPU thread will never enter kernel again and will not process SIPI. Signed-off-by: Gleb Natapov <[EMAIL PROTECTED]> diff --git a/qemu/hw/apic.c b/qemu/hw/apic.c index 52e424f..bdaa2fe 100644 --- a/qemu/hw/apic.c +++ b/qemu/hw/apic.c @@

[ kvm-Bugs-2149609 ] Booting IA32e Windows guest meets BSOD

2008-10-06 Thread SourceForge.net
Bugs item #2149609, was opened at 2008-10-06 16:25 Message generated for change (Comment added) made by kiszka You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=893831&aid=2149609&group_id=180599 Please note that this message will contain a full copy of the comment th

[ kvm-Bugs-2149609 ] Booting IA32e Windows guest meets BSOD

2008-10-06 Thread SourceForge.net
Bugs item #2149609, was opened at 2008-10-06 07:25 Message generated for change (Comment added) made by jiajun You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=893831&aid=2149609&group_id=180599 Please note that this message will contain a full copy of the comment th

Re: kvm-76 --std-vga problem

2008-10-06 Thread Glauber Costa
On Sun, Oct 5, 2008 at 9:52 PM, duck <[EMAIL PROTECTED]> wrote: > Michael Malone wrote: > When I run [kvm-76] it using the --std-vga parameter, windows boots to just before it gets to the "welcome" screen and hangs. The output shows a multitude of "kvm: get_dirty_pages returned

RE: thread/core siblings info for guests

2008-10-06 Thread Kamble, Nitin A
>From: Avi Kivity [mailto:[EMAIL PROTECTED] > >Indeed finer control over cpuid is needed. We need >to support at least three modes: > >- default: expose some machine that is likely to be widely supported >- host: expose as much of the host cpu as we can >- managed: management application controls

Re: thread/core siblings info for guests

2008-10-06 Thread Chris Wright
* Kamble, Nitin A ([EMAIL PROTECTED]) wrote: > >From: Avi Kivity [mailto:[EMAIL PROTECTED] > >Indeed finer control over cpuid is needed. We need > >to support at least three modes: > > > >- default: expose some machine that is likely to be widely supported > >- host: expose as much of the host cpu

Re: [PATCH 4/4] KVM: x86: Enable MSI for assigned device

2008-10-06 Thread Sheng Yang
On Monday 06 October 2008 11:36:08 Yang, Sheng wrote: > On Sunday 05 October 2008 18:27:20 Avi Kivity wrote: > > Sheng Yang wrote: > > > As well as export ioapic_get_delivery_bitmask(). > > > > > > @@ -132,8 +177,12 @@ static void > > > kvm_assigned_dev_interrupt_work_handler(struct work_struct *wo

Re: [PATCH 4/4] KVM: x86: Enable MSI for assigned device

2008-10-06 Thread Sheng Yang
Update according to the comments. Thanks! -- From: Sheng Yang <[EMAIL PROTECTED]> Date: Tue, 7 Oct 2008 14:04:24 +0800 Subject: [PATCH 4/4] KVM: x86: Enable MSI for assigned device As well as export ioapic_get_delivery_bitmask(). Signed-off-by: Sheng Yang <[EMAIL PROTECTED]> --- arch/x86/kvm/x8