Re: [PATCH] Ignore SRAO MCE if another MCE is being processed

2010-04-28 Thread Huang Ying
On Wed, 2010-04-28 at 00:12 +0800, Marcelo Tosatti wrote: On Tue, Apr 27, 2010 at 03:10:49PM +0800, Huang Ying wrote: In common cases, guest SRAO MCE will cause corresponding poisoned page be un-mapped in host and SIGBUS be sent to QEMU-KVM, then QEMU-KVM will relay the MCE to guest OS.

Re: [PATCH 09/23] KVM: x86 emulator: make set_cr() callback return error if it fails

2010-04-28 Thread Avi Kivity
On 04/27/2010 03:15 PM, Gleb Natapov wrote: Make set_cr() callback return error if it fails instead of injecting #GP behind emulator's back. -void kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) +static int _kvm_set_cr0(struct kvm_vcpu *vcpu, unsigned long cr0) { standard

Re: [PATCH 22/23] KVM: remove unneeded initialization.

2010-04-28 Thread Avi Kivity
On 04/27/2010 03:15 PM, Gleb Natapov wrote: This initialization is no longer needed. Signed-off-by: Gleb Natapovg...@redhat.com --- arch/x86/kvm/x86.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index ed15b20..29e2d3b

Re: [PATCH 08/23] KVM: x86 emulator: cleanup some direct calls into kvm to use existing callbacks

2010-04-28 Thread Avi Kivity
On 04/27/2010 03:15 PM, Gleb Natapov wrote: Use callbacks from x86_emulate_ops to access segments instead of calling into kvm directly. -static unsigned long seg_base(struct x86_emulate_ctxt *ctxt, int seg) +static unsigned long seg_base(struct x86_emulate_ctxt *ctxt, +

Re: [PATCH 15/23] KVM: do not inject #PF in (read|write)_emulated() callbacks

2010-04-28 Thread Gleb Natapov
On Wed, Apr 28, 2010 at 12:11:41PM +0300, Avi Kivity wrote: On 04/27/2010 03:15 PM, Gleb Natapov wrote: Return error to x86 emulator instead of injection exception behind its back. Signed-off-by: Gleb Natapovg...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |3 +++

Re: Pulling regularly from QEMU git repository

2010-04-28 Thread Avi Kivity
On 04/28/2010 07:37 AM, Gerhard Wiesinger wrote: Hello, I saw that KVM git repository is not updated from QEMU repository very often. Is it possible to integrate QEMU git tree into KVM git regularly as qemu git tree is very dynamic. E.g. last commit was more than 2 weeks ago. I think it is

Re: [SeaBIOS] About cpu_set, CPU hotplug and related subjects

2010-04-28 Thread Jes Sorensen
On 04/22/10 03:12, Kevin O'Connor wrote: As I understand it, the hotplug support was only in the kvm copy of bochs bios. It also limited the number of cpus one could use (I think 16). The current smp support in SeaBIOS doesn't limit the number of cpus. So, there has been reluctance to

[PATCH v2] KVM: x86: avoid unnecessary bitmap allocation when memslot is clean

2010-04-28 Thread Takuya Yoshikawa
Hi Marcelo, Avi, I updated the patch as follows. Changelog: 1. Inserted one r = -ENOMEM; line following Avi's advice. 2. Little change of explanation about performance improvements. I'm now testing and cleaning up my next patch series based on this, so please apply this if this makes sense

Re: [PATCH 2/2] KVM, Fix QEMU-KVM is killed by guest SRAO MCE

2010-04-28 Thread Avi Kivity
On 04/28/2010 05:56 AM, Huang Ying wrote: Just want to use the side effect of copy_from_user, SIGBUS will be sent to current process because the page touched is marked as poisoned. That is, failure is expected, so the return value is not checked. What if the failure doesn't

Re: [PATCH 15/23] KVM: do not inject #PF in (read|write)_emulated() callbacks

2010-04-28 Thread Avi Kivity
On 04/27/2010 03:15 PM, Gleb Natapov wrote: Return error to x86 emulator instead of injection exception behind its back. Signed-off-by: Gleb Natapovg...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |3 +++ arch/x86/kvm/emulate.c | 12 +++- arch/x86/kvm/x86.c

Re: [PATCHv2] qemu-kvm: fix crash on reboot with vhost-net

2010-04-28 Thread Juan Quintela
Michael S. Tsirkin m...@redhat.com wrote: When vhost-net is disabled on reboot, we set msix mask notifier to NULL to disable further mask/unmask notifications. Code currently tries to pass this NULL to notifier, leading to a crash. The right thing to do is to add explicit APIs to

KVM Networking Issues

2010-04-28 Thread Anthony Davis
Hi, Can anyone shed some light on a questions I have if possible? I know KVM uses dnsmasq for DHCP and DNS, but is it possible to not use this and use another DHCP server to dish out IP addresses? Now if my understanding is right, there is just a NAT created to access the VM? How is this

Re: [PATCH 08/23] KVM: x86 emulator: cleanup some direct calls into kvm to use existing callbacks

2010-04-28 Thread Gleb Natapov
On Wed, Apr 28, 2010 at 11:59:54AM +0300, Avi Kivity wrote: On 04/27/2010 03:15 PM, Gleb Natapov wrote: Use callbacks from x86_emulate_ops to access segments instead of calling into kvm directly. -static unsigned long seg_base(struct x86_emulate_ctxt *ctxt, int seg) +static unsigned

[PATCHv2] qemu-kvm: fix crash on reboot with vhost-net

2010-04-28 Thread Michael S. Tsirkin
When vhost-net is disabled on reboot, we set msix mask notifier to NULL to disable further mask/unmask notifications. Code currently tries to pass this NULL to notifier, leading to a crash. The right thing to do is to add explicit APIs to enable/disable notifications. Now when disabling

Re: [PATCH 1/1] KVM: x86: avoid unnecessary bitmap allocation when memslot is clean

2010-04-28 Thread Avi Kivity
On 04/28/2010 07:17 AM, Takuya Yoshikawa wrote: (2010/04/27 22:46), Takuya Yoshikawa wrote: (2010/04/27 22:18), Avi Kivity wrote: Furthermore, the reduced allocations seem to produce good effects for other cases too. Actually, I observed that the time for the ioctl was more stable than the

Re: [SeaBIOS] About cpu_set, CPU hotplug and related subjects

2010-04-28 Thread Gleb Natapov
On Wed, Apr 28, 2010 at 11:31:00AM +0200, Jes Sorensen wrote: On 04/22/10 03:12, Kevin O'Connor wrote: As I understand it, the hotplug support was only in the kvm copy of bochs bios. It also limited the number of cpus one could use (I think 16). The current smp support in SeaBIOS

Re: [PATCH v3 0/10] KVM MMU: allow more shadow pages become asynchronous

2010-04-28 Thread Avi Kivity
On 04/28/2010 06:54 AM, Xiao Guangrong wrote: Changlog v3: Reviewed-by: Avi Kivity a...@redhat.com -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More

Re: [SeaBIOS] About cpu_set, CPU hotplug and related subjects

2010-04-28 Thread Jes Sorensen
On 04/28/10 12:30, Gleb Natapov wrote: On Wed, Apr 28, 2010 at 11:31:00AM +0200, Jes Sorensen wrote: On 04/22/10 03:12, Kevin O'Connor wrote: Generating the more complex tables dynamically would be preferred, but it requires like half an AML compiler in Seabios, so it kinda stalled there

Re: [SeaBIOS] About cpu_set, CPU hotplug and related subjects

2010-04-28 Thread Gleb Natapov
On Wed, Apr 28, 2010 at 12:41:51PM +0200, Jes Sorensen wrote: On 04/28/10 12:30, Gleb Natapov wrote: On Wed, Apr 28, 2010 at 11:31:00AM +0200, Jes Sorensen wrote: On 04/22/10 03:12, Kevin O'Connor wrote: Generating the more complex tables dynamically would be preferred, but it requires

Re: [PATCH 11/22] KVM: MMU: Add infrastructure for two-level page walker

2010-04-28 Thread Joerg Roedel
On Tue, Apr 27, 2010 at 03:34:10PM +0300, Avi Kivity wrote: On 04/27/2010 01:38 PM, Joerg Roedel wrote: This patch introduces a mmu-callback to translate gpa addresses in the walk_addr code. This is later used to translate l2_gpa addresses into l1_gpa addresses. +static inline gfn_t

Re: [PATCH 11/22] KVM: MMU: Add infrastructure for two-level page walker

2010-04-28 Thread Joerg Roedel
On Tue, Apr 27, 2010 at 03:34:10PM +0300, Avi Kivity wrote: On 04/27/2010 01:38 PM, Joerg Roedel wrote: This patch introduces a mmu-callback to translate gpa addresses in the walk_addr code. This is later used to translate l2_gpa addresses into l1_gpa addresses. +static inline gfn_t

Re: [PATCH 3/9] KVM test: Make the login re suitable for serial console

2010-04-28 Thread Michael Goldish
On 04/26/2010 01:03 PM, Jason Wang wrote: Current matching re ^\s*[Ll]ogin:\s*$ is not suitable for the serial console, so change it to [Ll]ogin:. Signed-off-by: Jason Wang jasow...@redhat.com --- client/tests/kvm/kvm_utils.py |2 +- 1 files changed, 1 insertions(+), 1 deletions(-)

Re: [PATCH 1/1] KVM: x86: avoid unnecessary bitmap allocation when memslot is clean

2010-04-28 Thread Avi Kivity
On 04/27/2010 04:46 PM, Takuya Yoshikawa wrote: (2010/04/27 22:18), Avi Kivity wrote: Furthermore, the reduced allocations seem to produce good effects for other cases too. Actually, I observed that the time for the ioctl was more stable than the original one and the average time for dirty

Re: [PATCH 11/22] KVM: MMU: Add infrastructure for two-level page walker

2010-04-28 Thread Avi Kivity
On 04/28/2010 01:52 PM, Joerg Roedel wrote: On Tue, Apr 27, 2010 at 03:34:10PM +0300, Avi Kivity wrote: On 04/27/2010 01:38 PM, Joerg Roedel wrote: This patch introduces a mmu-callback to translate gpa addresses in the walk_addr code. This is later used to translate l2_gpa addresses

Re: [PATCH 1/9] KVM test: Introduce the prompt assist

2010-04-28 Thread Michael Goldish
On 04/26/2010 01:03 PM, Jason Wang wrote: Sometimes we need to send an assist string to a session in order to get the prompt especially when re-connecting to an already logged serial session. This patch send the assist string before doing the pattern matching of remote_login. Can you give an

Re: [PATCH 2/9] KVM test: Add the ability to send the username in remote_login()

2010-04-28 Thread Michael Goldish
On 04/26/2010 01:03 PM, Jason Wang wrote: In order to let the serial console work, we must let the remote_login() send the username when needed. Signed-off-by: Jason Wang jasow...@redhat.com --- client/tests/kvm/kvm_utils.py | 14 ++ 1 files changed, 10 insertions(+), 4

Re: [PATCH 11/22] KVM: MMU: Add infrastructure for two-level page walker

2010-04-28 Thread Avi Kivity
On 04/28/2010 02:03 PM, Joerg Roedel wrote: On Tue, Apr 27, 2010 at 03:34:10PM +0300, Avi Kivity wrote: On 04/27/2010 01:38 PM, Joerg Roedel wrote: This patch introduces a mmu-callback to translate gpa addresses in the walk_addr code. This is later used to translate l2_gpa addresses

[PATCH] kvm mmu: reduce 50% memory usage

2010-04-28 Thread Lai Jiangshan
I think users will enable tdp when their hardwares support ept or npt. This patch can reduce about 50% kvm mmu memory usage for they. This simple patch use the fact that: When sp-role.direct is set, sp-gfns does not contain any essential information, leaf sptes reachable from this sp are for a

Re: [Autotest] [PATCH 8/9] KVM test: Create the background threads before calling process()

2010-04-28 Thread Michael Goldish
On 04/26/2010 01:04 PM, Jason Wang wrote: If the screendump and scrialdump threads are created after the process(), we may lose the progress tracking of guest shutting down. So this patch creates them before calling process() in preprocess. Signed-off-by: Jason Wang jasow...@redhat.com ---

Re: [PATCH 7/9] KVM test: Introduce the local_login()

2010-04-28 Thread Michael Goldish
On 04/26/2010 01:04 PM, Jason Wang wrote: This patch introduces a new method which is used to log into the guest through the guest serial console. The serial_mode must be set to session in order to make use of this patch. In what cases would we want to use this feature? The serial console is

Re: [PATCH] kvm mmu: reduce 50% memory usage

2010-04-28 Thread Avi Kivity
On 04/28/2010 02:57 PM, Lai Jiangshan wrote: I think users will enable tdp when their hardwares support ept or npt. This patch can reduce about 50% kvm mmu memory usage for they. Good one! -- error compiling committee.c: too many arguments to function -- To unsubscribe from this list:

[PATCH 4/5] KVM: VMX: Add facility to atomically switch MSRs on guest entry/exit

2010-04-28 Thread Avi Kivity
Some guest msr values cannot be used on the host (for example. EFER.NX=0), so we need to switch them atomically during guest entry or exit. Add a facility to program the vmx msr autoload registers accordingly. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 49

[PATCH 3/5] KVM: VMX: Add definitions for guest and host EFER autoswitch vmcs entries

2010-04-28 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/include/asm/vmx.h |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h index 4497318..9e6779f 100644 --- a/arch/x86/include/asm/vmx.h +++

[PATCH 2/5] KVM: VMX: Add definition for msr autoload entry

2010-04-28 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/include/asm/vmx.h |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/arch/x86/include/asm/vmx.h b/arch/x86/include/asm/vmx.h index fb9a080..4497318 100644 --- a/arch/x86/include/asm/vmx.h +++

[PATCH 5/5] KVM: VMX: Atomically switch efer if EPT !EFER.NX

2010-04-28 Thread Avi Kivity
When EPT is enabled, we cannot emulate EFER.NX=0 through the shadow page tables. This causes accesses through ptes with bit 63 set to succeed instead of failing a reserved bit check. Signed-off-by: Avi Kivity a...@redhat.com --- arch/x86/kvm/vmx.c | 11 +++ 1 files changed, 11

[PATCH 1/5] KVM: Let vcpu structure alignment be determined at runtime

2010-04-28 Thread Avi Kivity
vmx and svm vcpus have different contents and therefore may have different alignmment requirements. Let each specify its required alignment. Signed-off-by: Avi Kivity a...@redhat.com --- arch/ia64/kvm/vmm.c |2 +- arch/powerpc/kvm/44x.c|2 +- arch/powerpc/kvm/book3s.c |3

[PATCH 0/5] Fix EFER.NX=0 with EPT

2010-04-28 Thread Avi Kivity
Currently we run with EFER.NX=1 on the guest even if the guest value is 0. This is fine with shadow, since we check bit 63 when instantiating a page table, and fault if bit 63 is set while EFER.NX is clear. This doesn't work with EPT, since we no longer get the change to check guest ptes. So we

Re: [PATCH 12/22] KVM: MMU: Implement nested gva_to_gpa functions

2010-04-28 Thread Joerg Roedel
On Tue, Apr 27, 2010 at 03:37:40PM +0300, Avi Kivity wrote: On 04/27/2010 01:38 PM, Joerg Roedel wrote: This patch adds the functions to do a nested l2_gva to l1_gpa page table walk. Signed-off-by: Joerg Roedeljoerg.roe...@amd.com --- arch/x86/include/asm/kvm_host.h |4

Potential thread synchronization issue in qcow2.c and qcow2-cluster.c

2010-04-28 Thread Chunqiang (CQ) Tang
Hi there, I am reading the snapshot source code of qemu-kvm-0.12.3, and am puzzled by the thread synchronization issue in qcow2.c and qcow2-cluster.c. Could someone please enlighten me? Thanks! Specifically, I found that BDRVQcowState.cluster_allocs, which is a QLIST_HEAD, may be accessed

Re: [PATCH 15/22] KVM: MMU: Introduce kvm_read_guest_page_x86()

2010-04-28 Thread Joerg Roedel
On Tue, Apr 27, 2010 at 04:35:06PM +0300, Avi Kivity wrote: Perhaps have struct kvm_mmu base_mmu; struct kvm_mmu nested_mmu; struct kvm_mmu *mmu; Okay, the pointer is only used in the gva_to_gpa path which is the minority of mmu context usages. I will introduce a struct

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

2010-04-28 Thread Anthony Liguori
On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: This is now done via the initialization's qemu_system_reset call. Signed-off-by: Avi Kivitya...@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

[PATCH 2/5] test: access: consolidate test failure reporting into a function

2010-04-28 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/access.c | 60 +++- 1 files changed, 37 insertions(+), 23 deletions(-) diff --git a/kvm/user/test/x86/access.c b/kvm/user/test/x86/access.c index dbc1213..0906691 100644 ---

[PATCH 1/5] test: access: split off test case formatting from execution

2010-04-28 Thread Avi Kivity
Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/access.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/kvm/user/test/x86/access.c b/kvm/user/test/x86/access.c index 5eadff8..dbc1213 100644 --- a/kvm/user/test/x86/access.c +++

[PATCH 4/5] test: access: allow the processor not to set pde.a if a fault occurs

2010-04-28 Thread Avi Kivity
Some processors only set accessed bits if the translation is valid; allow this behaviour. This squelchs errors running with EPT. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/access.c | 25 - 1 files changed, 20 insertions(+), 5 deletions(-) diff

[PATCH 3/5] test: access: report successful tests optionally

2010-04-28 Thread Avi Kivity
There are so many tests, no point in reporting successful ones. Leave the capability optional in case a failure triggers a kvm or testsuite crash before the report is complete and we need to see which test failed. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/access.c | 15

[PATCH 5/5] test: access: don't expect fetch fault indication if !efer.nx

2010-04-28 Thread Avi Kivity
Bit 4 of the page-fault error code can only be set if efer.nx=1. Signed-off-by: Avi Kivity a...@redhat.com --- kvm/user/test/x86/access.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/kvm/user/test/x86/access.c b/kvm/user/test/x86/access.c index 5addd15..3338fbc

Re: [PATCH] virtio-spec: document block CMD and FLUSH

2010-04-28 Thread Michael S. Tsirkin
On Tue, Apr 20, 2010 at 12:26:27AM +0300, Michael S. Tsirkin wrote: On Fri, Feb 19, 2010 at 12:22:20AM +0200, Michael S. Tsirkin wrote: I took a stub at documenting CMD and FLUSH request types in virtio block. Any comments? Rusty? -- To unsubscribe from this list: send the line

[PATCHv2 01/23] KVM: x86 emulator: introduce read cache.

2010-04-28 Thread Gleb Natapov
Introduce read cache which is needed for instruction that require more then one exit to userspace. After returning from userspace the instruction will be re-executed with cached read value. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1 +

[PATCHv2 03/23] KVM: x86 emulator: cleanup xchg emulation.

2010-04-28 Thread Gleb Natapov
Dst operand is already initialized during decoding stage. No need to reinitialize. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index

[PATCHv2 02/23] KVM: x86 emulator: fix Move r/m16 to segment register decoding.

2010-04-28 Thread Gleb Natapov
This instruction does not need generic decoding for its dst operand. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index 6f40337..efb7853 100644 ---

[PATCHv2 04/23] KVM: x86 emulator: cleanup nop emulation

2010-04-28 Thread Gleb Natapov
Make it more explicit what we are checking for. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c index ea5c6fd..fbc555b 100644 ---

[PATCHv2 00/23] next round of emulator cleanups

2010-04-28 Thread Gleb Natapov
This is the next round of emulator cleanups. Make it even more detached from kvm. First patch introduces IO read cache which is needed to correctly emulate instructions that require more then one IO read exit during emulation. ChangeLog; v1-v2: - add x86_emulator_ops callback to get cached

[PATCHv2 20/23] KVM: x86 emulator: use shadowed register in emulate_sysexit()

2010-04-28 Thread Gleb Natapov
emulate_sysexit() should use shadowed registers copy instead of looking into vcpu state directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c

[PATCHv2 23/23] KVM: x86 emulator: do not inject exception directly into vcpu

2010-04-28 Thread Gleb Natapov
Return exception as a result of instruction emulation and handle injection in KVM code. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |6 ++ arch/x86/kvm/emulate.c | 124 ++-- arch/x86/kvm/x86.c

[PATCHv2 16/23] KVM: do not inject #PF in (read|write)_emulated() callbacks

2010-04-28 Thread Gleb Natapov
Return error to x86 emulator instead of injection exception behind its back. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |3 +++ arch/x86/kvm/emulate.c | 12 +++- arch/x86/kvm/x86.c | 28

[PATCHv2 22/23] KVM: x86 emulator: move interruptibility state tracking out of emulator

2010-04-28 Thread Gleb Natapov
Emulator shouldn't access vcpu directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c | 19 ++- arch/x86/kvm/x86.c | 20 +--- 2 files changed, 19 insertions(+), 20 deletions(-) diff --git a/arch/x86/kvm/emulate.c

[PATCHv2 15/23] KVM: remove export of emulator_write_emulated().

2010-04-28 Thread Gleb Natapov
It is not called directly outside of the file it's defined in anymore. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_host.h |5 - arch/x86/kvm/x86.c |1 - 2 files changed, 0 insertions(+), 6 deletions(-) diff --git

[PATCHv2 17/23] KVM: handle emulation failure case first.

2010-04-28 Thread Gleb Natapov
If emulation failed return immediately. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/x86.c | 31 +++ 1 files changed, 15 insertions(+), 16 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 696b34b..445769b 100644 ---

[PATCHv2 18/23] KVM: x86 emulator: advance RIP outside x86 emulator code

2010-04-28 Thread Gleb Natapov
Return new RIP as part of instruction emulation result instead of updating KVM's RIP from x86 emulator code. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c |7 --- arch/x86/kvm/x86.c |4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git

[PATCHv2 09/23] KVM: x86 emulator: cleanup some direct calls into kvm to use existing callbacks

2010-04-28 Thread Gleb Natapov
Use callbacks from x86_emulate_ops to access segments instead of calling into kvm directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c | 200 +--- 1 files changed, 105 insertions(+), 95 deletions(-) diff --git

[PATCHv2 11/23] KVM: x86 emulator: make (get|set)_dr() callback return error if it fails

2010-04-28 Thread Gleb Natapov
Make (get|set)_dr() callback return error if it fails instead of injecting exception behind emulator's back. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/kvm/emulate.c | 11 ++-- arch/x86/kvm/x86.c | 63 --- 2 files changed, 45

[PATCHv2 08/23] KVM: x86 emulator: add get_cached_segment_base() callback to x86_emulate_ops.

2010-04-28 Thread Gleb Natapov
On VMX it is expensive to call get_cached_descriptor() just to get segment base since multiple vmcs_reads are done instead of only one. Introduce new call back get_cached_segment_base() for efficiency. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |1 +

[PATCHv2 10/23] KVM: x86 emulator: make set_cr() callback return error if it fails

2010-04-28 Thread Gleb Natapov
Make set_cr() callback return error if it fails instead of injecting #GP behind emulator's back. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |2 +- arch/x86/kvm/emulate.c | 10 ++- arch/x86/kvm/x86.c | 148

[PATCHv2 06/23] KVM: x86 emulator: add (set|get)_dr callbacks to x86_emulate_ops

2010-04-28 Thread Gleb Natapov
Add (set|get)_dr callbacks to x86_emulate_ops instead of calling them directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |2 ++ arch/x86/include/asm/kvm_host.h|4 arch/x86/kvm/emulate.c |7 +-- arch/x86/kvm/x86.c

[PATCHv2 14/23] KVM: x86 emulator: x86_emulate_insn() return -1 only in case of emulation failure

2010-04-28 Thread Gleb Natapov
Currently emulator returns -1 when emulation failed or IO is needed. Caller tries to guess whether emulation failed by looking at other variables. Make it easier for caller to recognise error condition by always returning -1 in case of failure. For this new emulator internal return value

[PATCHv2 05/23] KVM: x86 emulator: handle far address source operand.

2010-04-28 Thread Gleb Natapov
ljmp/lcall instruction operand contains address and segment. It can be 10 bytes long. Currently we decode it as two different operands. Fix it by introducing new kind of operand that can hold entire far address. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |

[PATCHv2 07/23] KVM: x86 emulator: add (set|get)_msr callbacks to x86_emulate_ops

2010-04-28 Thread Gleb Natapov
Add (set|get)_msr callbacks to x86_emulate_ops instead of calling them directly. Signed-off-by: Gleb Natapov g...@redhat.com --- arch/x86/include/asm/kvm_emulate.h |2 ++ arch/x86/kvm/emulate.c | 36 ++-- arch/x86/kvm/x86.c |2

Re: [Qemu-devel] Re: [PATCH 06/10] kvm: remove explicit kvm_arch_reset_vcpu from kvm_init_vcpu

2010-04-28 Thread Marcelo Tosatti
On Wed, Apr 28, 2010 at 10:39:06AM -0500, Anthony Liguori wrote: On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: This is now done via the initialization's qemu_system_reset call. Signed-off-by: Avi Kivitya...@redhat.com --- kvm-all.c |1 - 1 files changed, 0 insertions(+), 1

Re: [PATCH] Ignore SRAO MCE if another MCE is being processed

2010-04-28 Thread Marcelo Tosatti
On Tue, Apr 27, 2010 at 03:10:49PM +0800, Huang Ying wrote: In common cases, guest SRAO MCE will cause corresponding poisoned page be un-mapped in host and SIGBUS be sent to QEMU-KVM, then QEMU-KVM will relay the MCE to guest OS. But it is possible that the poisoned page is accessed in guest

Re: [PATCH 2/2] Add test for ljmp.

2010-04-28 Thread Marcelo Tosatti
On Tue, Apr 27, 2010 at 03:56:04PM +0300, Gleb Natapov wrote: Test that ljmp with operand in IO memory works. Signed-off-by: Gleb Natapov g...@redhat.com Applied both, thanks. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

Re: [Qemu-devel] Re: [PATCH 06/10] kvm: remove explicit kvm_arch_reset_vcpu from kvm_init_vcpu

2010-04-28 Thread Anthony Liguori
On 04/28/2010 11:22 AM, Marcelo Tosatti wrote: On Wed, Apr 28, 2010 at 10:39:06AM -0500, Anthony Liguori wrote: On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: This is now done via the initialization's qemu_system_reset call. Signed-off-by: Avi Kivitya...@redhat.com --- kvm-all.c |

Re: [Qemu-devel] Re: [PATCH 06/10] kvm: remove explicit kvm_arch_reset_vcpu from kvm_init_vcpu

2010-04-28 Thread Marcelo Tosatti
On Wed, Apr 28, 2010 at 01:22:14PM -0300, Marcelo Tosatti wrote: On Wed, Apr 28, 2010 at 10:39:06AM -0500, Anthony Liguori wrote: On 04/26/2010 12:59 PM, Marcelo Tosatti wrote: This is now done via the initialization's qemu_system_reset call. Signed-off-by: Avi Kivitya...@redhat.com

Re: [PATCH v3 0/10] KVM MMU: allow more shadow pages become asynchronous

2010-04-28 Thread Marcelo Tosatti
On Wed, Apr 28, 2010 at 11:54:31AM +0800, Xiao Guangrong wrote: Changlog v3: Those changes all form Avi's suggestion, thanks. - use smart way to fix the bug in patch 1 - remove duplicates code in patch 5 - check error code and fix forgot release page in patch 9 - sync shadow pages in a

Re: [PATCH] Ignore SRAO MCE if another MCE is being processed

2010-04-28 Thread Avi Kivity
On 04/28/2010 09:08 AM, Huang Ying wrote: There is some test script and document for this in: git://git.kernel.org/pub/scm/utils/cpu/mce/mce-test.git test script is in kvm directory, testing document is kvm/README This is a good candidate for kvm-autotest. We'll get little user

Re: [PATCHv2] qemu-kvm: fix crash on reboot with vhost-net

2010-04-28 Thread Marcelo Tosatti
On Wed, Apr 28, 2010 at 12:27:38PM +0300, Michael S. Tsirkin wrote: When vhost-net is disabled on reboot, we set msix mask notifier to NULL to disable further mask/unmask notifications. Code currently tries to pass this NULL to notifier, leading to a crash. The right thing to do is to add

Re: [PATCH] kvm mmu: reduce 50% memory usage

2010-04-28 Thread Marcelo Tosatti
On Wed, Apr 28, 2010 at 07:57:01PM +0800, Lai Jiangshan wrote: I think users will enable tdp when their hardwares support ept or npt. This patch can reduce about 50% kvm mmu memory usage for they. This simple patch use the fact that: When sp-role.direct is set, sp-gfns does not contain

Regression in vga performance between 0.11.1 and 0.12.1.1

2010-04-28 Thread Adam Greenblatt
Hi, I noticed that certain guests (for example, Ubuntu 9.04, Ubuntu 9.10, and the Ubuntu 10.04 release candidate) show dramatically (~100x) slower graphical output when running under qemu-kvm-0.12.1.1 than under qemu-kvm-0.11.1. Other guests, notably Windows XP and Windows Vista, run fine

Re: [PATCHv2] qemu-kvm: fix crash on reboot with vhost-net

2010-04-28 Thread Michael S. Tsirkin
On Wed, Apr 28, 2010 at 02:43:05PM -0300, Marcelo Tosatti wrote: Signed-off-by: Michael S. Tsirkin m...@redhat.com Applied, thanks. Can you tell me what commit id it has pls (for backport to rhel6). -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to

[RHEL6.0 PATCH] qemu-kvm: fix crash on reboot with vhost-net

2010-04-28 Thread Michael S. Tsirkin
Bugzilla: 585940 Upstream status: applied on qemu-kvm.git, commit 992cc816c42f2e93db033919a9ddbfcd1da4 When vhost-net is disabled on reboot, we set msix mask notifier to NULL to disable further mask/unmask notifications. Code currently tries to pass this NULL to notifier, leading to a crash.

Can I simulate a virtual Dual-Head Graphiccard?

2010-04-28 Thread Axel Kittenberger
Hello, This is a question I was not able to answer with a search. I've been using kvm now quite successfully as server side solution. Now I want to use it on a particular desktop to have a Windows 7 Guest on a native Linux system. Well this desktop has two Screens, and I'm sure its expected

[PATCHv7] add mergeable buffers support to vhost_net

2010-04-28 Thread David L Stevens
This patch adds mergeable receive buffer support to vhost_net. Signed-off-by: David L Stevens dlstev...@us.ibm.com diff -ruNp net-next-v0/drivers/vhost/net.c net-next-v7/drivers/vhost/net.c --- net-next-v0/drivers/vhost/net.c 2010-04-24 21:36:54.0 -0700 +++

Re: Can I simulate a virtual Dual-Head Graphiccard?

2010-04-28 Thread Brian Jackson
On Wednesday, April 28, 2010 03:08:24 pm Axel Kittenberger wrote: Hello, This is a question I was not able to answer with a search. I've been using kvm now quite successfully as server side solution. Now I want to use it on a particular desktop to have a Windows 7 Guest on a native Linux

Re: [RHEL6.0 PATCH] qemu-kvm: fix crash on reboot with vhost-net

2010-04-28 Thread Michael S. Tsirkin
On Wed, Apr 28, 2010 at 11:16:15PM +0300, Michael S. Tsirkin wrote: Bugzilla: 585940 Upstream status: applied on qemu-kvm.git, commit 992cc816c42f2e93db033919a9ddbfcd1da4 Please disregard, sent to this list in error. Sorry about the noise. -- To unsubscribe from this list: send the line

High CPU load on target host after migration

2010-04-28 Thread Thomas Beinicke
Hi, I have been toying around with kvm / libvirt / virt-manager and it's migration feature. Both host machines are running a 2.6.33 Kernel. One host is a Dual Quad Core Intel Xeon E5520 @ 2.27GHz and the other is a Dual Quad Core Intel E5420 @ 2.50GHz. Migrating Linux machines works great

Re: [PATCH 2/2] KVM, Fix QEMU-KVM is killed by guest SRAO MCE

2010-04-28 Thread Huang Ying
On Wed, 2010-04-28 at 17:47 +0800, Avi Kivity wrote: On 04/28/2010 05:56 AM, Huang Ying wrote: Just want to use the side effect of copy_from_user, SIGBUS will be sent to current process because the page touched is marked as poisoned. That is, failure is expected, so the return value

RE: [RFC][PATCH v4 00/18] Provide a zero-copy method on KVM virtio-net.

2010-04-28 Thread Xin, Xiaohui
The idea is simple, just to pin the guest VM user space and then let host NIC driver has the chance to directly DMA to it. Isn't it much easier to map the RX ring of the network device into the guest's address space, have DMA map calls translate guest addresses to physical/DMA addresses

RE: [RFC][PATCH v4 05/18] Add a function to indicate if device use external buffer.

2010-04-28 Thread Xin, Xiaohui
+static int dev_is_mpassthru(struct net_device *dev) bool return value should be better here. -- Regards, Changli Gao(xiao...@gmail.com) Thanks, would fix that. Thanks Xiaohui -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to