[PATCH v4 0/2] Basic nested VMX test suite

2013-07-17 Thread Arthur Chunqi Li
These two patches are focued on providing a basic version of VMX nested test suite. This commit provides the architecture of nested VMX similiar to x86/svm.c. When new test suite added, just write functions included in struct vmx_test and register it in array vmx_tests. GPR in guest can be read

[PATCH v4 1/2] kvm-unit-tests : Add setjmp/longjmp to libcflat

2013-07-17 Thread Arthur Chunqi Li
Add setjmp and longjmp functions to libcflat. Now these two functions are only supported in X86_64 arch. New files added: lib/x86/setjmp64.S lib/x86/setjmp64.c Signed-off-by: Arthur Chunqi Li yzt...@gmail.com --- config-x86_64.mak |2 ++ lib/setjmp.h | 11

[PATCH v4 2/2] kvm-unit-tests : The first version of VMX nested test case

2013-07-17 Thread Arthur Chunqi Li
This is the first version for VMX nested environment test case. It contains the basic VMX instructions test cases, including VMXON/ VMXOFF/VMXPTRLD/VMXPTRST/VMCLEAR/VMLAUNCH/VMRESUME/VMCALL. This patch also tests the basic execution routine in VMX nested environment and let the VM print Hello

Re: [PATCH v4 0/2] Basic nested VMX test suite

2013-07-17 Thread Arthur Chunqi Li
Hi Gleb and Paolo, As your suggestion, I add general interface for adding test suite in this version. It is similar to the achievement of x86/vmx.c, and I also move tests for vmenter (vmlaunch and vmresume test) to an independent test suite. Arthur On Wed, Jul 17, 2013 at 2:05 PM, Arthur Chunqi

Re: [PATCH v4 0/2] Basic nested VMX test suite

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 02:08:54PM +0800, Arthur Chunqi Li wrote: Hi Gleb and Paolo, As your suggestion, I add general interface for adding test suite in this version. It is similar to the achievement of x86/vmx.c, and I also move tests for vmenter (vmlaunch and vmresume test) to an

Re: [PATCH v4 2/2] kvm-unit-tests : The first version of VMX nested test case

2013-07-17 Thread Jan Kiszka
On 2013-07-17 08:05, Arthur Chunqi Li wrote: This is the first version for VMX nested environment test case. It contains the basic VMX instructions test cases, including VMXON/ VMXOFF/VMXPTRLD/VMXPTRST/VMCLEAR/VMLAUNCH/VMRESUME/VMCALL. This patch also tests the basic execution routine in VMX

Re: [PATCH v4 2/2] kvm-unit-tests : The first version of VMX nested test case

2013-07-17 Thread Arthur Chunqi Li
On Wed, Jul 17, 2013 at 2:26 PM, Jan Kiszka jan.kis...@web.de wrote: On 2013-07-17 08:05, Arthur Chunqi Li wrote: This is the first version for VMX nested environment test case. It contains the basic VMX instructions test cases, including VMXON/

Re: [PATCH v4 0/2] Basic nested VMX test suite

2013-07-17 Thread Paolo Bonzini
Il 17/07/2013 08:21, Gleb Natapov ha scritto: On Wed, Jul 17, 2013 at 02:08:54PM +0800, Arthur Chunqi Li wrote: Hi Gleb and Paolo, As your suggestion, I add general interface for adding test suite in this version. It is similar to the achievement of x86/vmx.c, and I also move tests for

Re: [PATCH v4 0/2] Basic nested VMX test suite

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 09:52:57AM +0200, Paolo Bonzini wrote: Il 17/07/2013 08:21, Gleb Natapov ha scritto: On Wed, Jul 17, 2013 at 02:08:54PM +0800, Arthur Chunqi Li wrote: Hi Gleb and Paolo, As your suggestion, I add general interface for adding test suite in this version. It is

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 12:12:35AM +0530, Raghavendra K T wrote: I do not think it is very rare to get interrupt between local_irq_restore() and halt() under load since any interrupt that occurs between local_irq_save() and local_irq_restore() will be delivered immediately after

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Raghavendra K T
On 07/17/2013 03:04 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 12:12:35AM +0530, Raghavendra K T wrote: I do not think it is very rare to get interrupt between local_irq_restore() and halt() under load since any interrupt that occurs between local_irq_save() and local_irq_restore() will be

Re: [PATCH v4 2/2] kvm-unit-tests : The first version of VMX nested test case

2013-07-17 Thread Paolo Bonzini
Il 17/07/2013 08:05, Arthur Chunqi Li ha scritto: + guest_rip = vmcs_read(GUEST_RIP); + reason = vmcs_read(EXI_REASON) 0xff; + + switch (reason) { + case VMX_VMCALL: + print_vmexit_info(); + vmcs_write(GUEST_RIP, guest_rip + 3); + goto

Re: [PATCH v4 0/2] Basic nested VMX test suite

2013-07-17 Thread Paolo Bonzini
Il 17/07/2013 11:03, Gleb Natapov ha scritto: On Wed, Jul 17, 2013 at 09:52:57AM +0200, Paolo Bonzini wrote: Il 17/07/2013 08:21, Gleb Natapov ha scritto: On Wed, Jul 17, 2013 at 02:08:54PM +0800, Arthur Chunqi Li wrote: Hi Gleb and Paolo, As your suggestion, I add general interface for

Re: [PATCH v4 0/2] Basic nested VMX test suite

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 12:19:32PM +0200, Paolo Bonzini wrote: Il 17/07/2013 11:03, Gleb Natapov ha scritto: On Wed, Jul 17, 2013 at 09:52:57AM +0200, Paolo Bonzini wrote: Il 17/07/2013 08:21, Gleb Natapov ha scritto: On Wed, Jul 17, 2013 at 02:08:54PM +0800, Arthur Chunqi Li wrote: Hi

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Correct tlbie usage

2013-07-17 Thread Aneesh Kumar K.V
Paul Mackerras pau...@samba.org writes: This corrects the usage of the tlbie (TLB invalidate entry) instruction in HV KVM. The tlbie instruction changed between PPC970 and POWER7. On the PPC970, the bit to select large vs. small page is in the instruction, not in the RB register value. This

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Raghavendra K T
On 07/17/2013 03:35 PM, Raghavendra K T wrote: On 07/17/2013 03:04 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 12:12:35AM +0530, Raghavendra K T wrote: I do not think it is very rare to get interrupt between local_irq_restore() and halt() under load since any interrupt that occurs between

Re: [PATCH v4 0/2] Basic nested VMX test suite

2013-07-17 Thread Jan Kiszka
On 2013-07-17 12:31, Gleb Natapov wrote: I think the current version is mostly fine, but I'd prefer to move the inline functions to vmx.h, and the tests to a separate file. Perhaps lib/x86/vmx.h, lib/x86/vmx.c, and x86/vmx.c. All knowledge of setjmp and longjmp should then be hidden in

Re: [PATCH v4 0/2] Basic nested VMX test suite

2013-07-17 Thread Paolo Bonzini
Il 17/07/2013 12:31, Gleb Natapov ha scritto: On Wed, Jul 17, 2013 at 12:19:32PM +0200, Paolo Bonzini wrote: Il 17/07/2013 11:03, Gleb Natapov ha scritto: This is not about taste, this is about hackability of the code. I will maintain it and I want it to be as simple as possible given task

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Gleb Natapov
On Tue, Jul 16, 2013 at 06:04:34PM -0500, Scott Wood wrote: On 07/16/2013 01:35:55 AM, Gleb Natapov wrote: On Mon, Jul 15, 2013 at 01:17:33PM -0500, Scott Wood wrote: On 07/15/2013 06:30:20 AM, Gleb Natapov wrote: There is no much sense to share hypercalls between architectures. There is

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Alexander Graf
On 17.07.2013, at 13:00, Gleb Natapov wrote: On Tue, Jul 16, 2013 at 06:04:34PM -0500, Scott Wood wrote: On 07/16/2013 01:35:55 AM, Gleb Natapov wrote: On Mon, Jul 15, 2013 at 01:17:33PM -0500, Scott Wood wrote: On 07/15/2013 06:30:20 AM, Gleb Natapov wrote: There is no much sense to share

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 03:35:37PM +0530, Raghavendra K T wrote: Instead of halt we started with a sleep hypercall in those versions. Changed to halt() once Avi suggested to reuse existing sleep. If we use older hypercall with few changes like below: kvm_pv_wait_for_kick_op(flags, vcpu,

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Raghavendra K T
On 07/17/2013 06:15 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 03:35:37PM +0530, Raghavendra K T wrote: Instead of halt we started with a sleep hypercall in those versions. Changed to halt() once Avi suggested to reuse existing sleep. If we use older hypercall with few changes like

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 06:25:05PM +0530, Raghavendra K T wrote: On 07/17/2013 06:15 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 03:35:37PM +0530, Raghavendra K T wrote: Instead of halt we started with a sleep hypercall in those versions. Changed to halt() once Avi suggested to reuse

Re: [PATCH v4 0/2] Basic nested VMX test suite

2013-07-17 Thread Arthur Chunqi Li
Actually, both structure are kind to me and except for some concerns Gleb's solutions seems easier to read. The first concern is Gleb's way cannot set a seperate stack for HOST_RSP, which I predefined this can be set by test suite's init function. I have discussed with Jan and he said we don't

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Raghavendra K T
On 07/17/2013 06:55 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 06:25:05PM +0530, Raghavendra K T wrote: On 07/17/2013 06:15 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 03:35:37PM +0530, Raghavendra K T wrote: Instead of halt we started with a sleep hypercall in those versions.

Re: Linux Plumbers ACPI/PM, PCI Microconference

2013-07-17 Thread Shuah Khan
Myron, On Tue, Jul 16, 2013 at 8:21 PM, Myron Stowe myron.st...@gmail.com wrote: Shuah - You brought up the idea about Converting drivers from Legacy PM ops to dev_pm_ops; would you like to present what you have done/encountered so far? Awesome. Yes, I would like to present what I have

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Raghavendra K T
On 07/17/2013 07:43 PM, Raghavendra K T wrote: On 07/17/2013 06:55 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 06:25:05PM +0530, Raghavendra K T wrote: On 07/17/2013 06:15 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 03:35:37PM +0530, Raghavendra K T wrote: Instead of halt we started

[PATCH] KVM: PPC: Book3S PR: return appropriate error when allocation fails

2013-07-17 Thread Thadeu Lima de Souza Cascardo
err was overwritten by a previous function call, and checked to be 0. If the following page allocation fails, 0 is going to be returned instead of -ENOMEM. Signed-off-by: Thadeu Lima de Souza Cascardo casca...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_pr.c |5 +++-- 1 files changed, 3

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 07:43:01PM +0530, Raghavendra K T wrote: On 07/17/2013 06:55 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 06:25:05PM +0530, Raghavendra K T wrote: On 07/17/2013 06:15 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 03:35:37PM +0530, Raghavendra K T wrote: Instead of

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Alexander Graf
On 17.07.2013, at 17:19, Yoder Stuart-B08248 wrote: -Original Message- From: Alexander Graf [mailto:ag...@suse.de] Sent: Wednesday, July 17, 2013 7:19 AM To: Gleb Natapov Cc: Wood Scott-B07421; Bhushan Bharat-R65777; kvm@vger.kernel.org; kvm-...@vger.kernel.org; Yoder

RE: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Yoder Stuart-B08248
-Original Message- From: Alexander Graf [mailto:ag...@suse.de] Sent: Wednesday, July 17, 2013 7:19 AM To: Gleb Natapov Cc: Wood Scott-B07421; Bhushan Bharat-R65777; kvm@vger.kernel.org; kvm-...@vger.kernel.org; Yoder Stuart-B08248; Bhushan Bharat-R65777 Subject: Re: [PATCH 3/5]

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 08:25:19PM +0530, Raghavendra K T wrote: On 07/17/2013 08:14 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 07:43:01PM +0530, Raghavendra K T wrote: On 07/17/2013 06:55 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 06:25:05PM +0530, Raghavendra K T wrote: On

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Raghavendra K T
On 07/17/2013 08:25 PM, Raghavendra K T wrote: On 07/17/2013 08:14 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 07:43:01PM +0530, Raghavendra K T wrote: On 07/17/2013 06:55 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 06:25:05PM +0530, Raghavendra K T wrote: On 07/17/2013 06:15 PM,

RE: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Yoder Stuart-B08248
-Original Message- From: Alexander Graf [mailto:ag...@suse.de] Sent: Wednesday, July 17, 2013 10:21 AM To: Yoder Stuart-B08248 Cc: Wood Scott-B07421; Bhushan Bharat-R65777; kvm@vger.kernel.org; kvm-...@vger.kernel.org; Gleb Natapov Subject: Re: [PATCH 3/5] booke: define reset and

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Alexander Graf
On 17.07.2013, at 17:36, Yoder Stuart-B08248 wrote: -Original Message- From: Alexander Graf [mailto:ag...@suse.de] Sent: Wednesday, July 17, 2013 10:21 AM To: Yoder Stuart-B08248 Cc: Wood Scott-B07421; Bhushan Bharat-R65777; kvm@vger.kernel.org; kvm-...@vger.kernel.org; Gleb

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Raghavendra K T
On 07/17/2013 08:41 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 08:25:19PM +0530, Raghavendra K T wrote: On 07/17/2013 08:14 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 07:43:01PM +0530, Raghavendra K T wrote: On 07/17/2013 06:55 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at

Re: [PATCH RFC V10 15/18] kvm : Paravirtual ticketlocks support for linux guests running on KVM hypervisor

2013-07-17 Thread Raghavendra K T
On 07/17/2013 08:14 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 07:43:01PM +0530, Raghavendra K T wrote: On 07/17/2013 06:55 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 06:25:05PM +0530, Raghavendra K T wrote: On 07/17/2013 06:15 PM, Gleb Natapov wrote: On Wed, Jul 17, 2013 at

Re: [PATCH v4 0/2] Basic nested VMX test suite

2013-07-17 Thread Paolo Bonzini
Il 17/07/2013 15:48, Arthur Chunqi Li ha scritto: Actually, both structure are kind to me and except for some concerns Gleb's solutions seems easier to read. The first concern is Gleb's way cannot set a seperate stack for HOST_RSP, which I predefined this can be set by test suite's init

RE: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Bhushan Bharat-R65777
On 17.07.2013, at 13:00, Gleb Natapov wrote: On Tue, Jul 16, 2013 at 06:04:34PM -0500, Scott Wood wrote: On 07/16/2013 01:35:55 AM, Gleb Natapov wrote: On Mon, Jul 15, 2013 at 01:17:33PM -0500, Scott Wood wrote: On 07/15/2013 06:30:20 AM, Gleb Natapov wrote: There is no much sense

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Alexander Graf
On 17.07.2013, at 17:47, Bhushan Bharat-R65777 wrote: On 17.07.2013, at 13:00, Gleb Natapov wrote: On Tue, Jul 16, 2013 at 06:04:34PM -0500, Scott Wood wrote: On 07/16/2013 01:35:55 AM, Gleb Natapov wrote: On Mon, Jul 15, 2013 at 01:17:33PM -0500, Scott Wood wrote: On 07/15/2013

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Alexander Graf
On 17.07.2013, at 17:59, Bhushan Bharat-R65777 wrote: -Original Message- From: Alexander Graf [mailto:ag...@suse.de] Sent: Wednesday, July 17, 2013 9:22 PM To: Bhushan Bharat-R65777 Cc: Yoder Stuart-B08248; Wood Scott-B07421; kvm@vger.kernel.org; kvm- p...@vger.kernel.org; Gleb

Windows Guest to Windows Guest on Same host is impossibly slow

2013-07-17 Thread Mike Nielsen
I'm not sure if I'm submitting this to the proper place or not, if not, please direct me accordingly. At this point I'm starting to get desperate, I'll take any options or suggestions that spring to mind: Anyway, the problem exists on multiple hosts of various quality.   From 4 core 8g mem

KVM internal error. Suberror: 1, emulation failure

2013-07-17 Thread Dave Hansen
I'm causing qemu to spew these emulation failure messages until I kill it. The guest kernel being run has been hacked up pretty heavily and is probably either accessing bad physical addresses (above the address ranges in the e820 table) or trying to DMA to bad addresses. What I'd really like

RE: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Bhushan Bharat-R65777
On 17.07.2013, at 13:00, Gleb Natapov wrote: On Tue, Jul 16, 2013 at 06:04:34PM -0500, Scott Wood wrote: On 07/16/2013 01:35:55 AM, Gleb Natapov wrote: On Mon, Jul 15, 2013 at 01:17:33PM -0500, Scott Wood wrote: On 07/15/2013 06:30:20 AM, Gleb Natapov wrote: There is no much sense to

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Alexander Graf
On 17.07.2013, at 18:21, Bhushan Bharat-R65777 wrote: On 17.07.2013, at 13:00, Gleb Natapov wrote: On Tue, Jul 16, 2013 at 06:04:34PM -0500, Scott Wood wrote: On 07/16/2013 01:35:55 AM, Gleb Natapov wrote: On Mon, Jul 15, 2013 at 01:17:33PM -0500, Scott Wood wrote: On 07/15/2013 06:30:20

commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Markus Trippelsdorf
The following commit: commit f8f559422b6c6a05469dfde614b67789b6142cb5 Author: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Date: Fri Jun 7 16:51:26 2013 +0800 KVM: MMU: fast invalidate all mmio sptes causes my kvm qemu qcow2 images to hang when they switch from the boot console to

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 06:32:15PM +0200, Markus Trippelsdorf wrote: The following commit: commit f8f559422b6c6a05469dfde614b67789b6142cb5 Author: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Date: Fri Jun 7 16:51:26 2013 +0800 KVM: MMU: fast invalidate all mmio sptes causes

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Markus Trippelsdorf
On 2013.07.17 at 19:42 +0300, Gleb Natapov wrote: On Wed, Jul 17, 2013 at 06:32:15PM +0200, Markus Trippelsdorf wrote: The following commit: commit f8f559422b6c6a05469dfde614b67789b6142cb5 Author: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com Date: Fri Jun 7 16:51:26 2013 +0800

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Scott Wood
On 07/17/2013 11:04:08 AM, Alexander Graf wrote: On 17.07.2013, at 17:59, Bhushan Bharat-R65777 wrote: Ah, so we can choose any address range in ccsr space of a PV machine (-M ppce500 / e500plat). No, we don't put it in CCSR space. It'd just be orthogonal to CCSR. I'd rather we put it

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Alexander Graf
On 17.07.2013, at 18:59, Scott Wood wrote: On 07/17/2013 11:04:08 AM, Alexander Graf wrote: On 17.07.2013, at 17:59, Bhushan Bharat-R65777 wrote: Ah, so we can choose any address range in ccsr space of a PV machine (-M ppce500 / e500plat). No, we don't put it in CCSR space. It'd just be

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Scott Wood
On 07/17/2013 12:05:41 PM, Alexander Graf wrote: On 17.07.2013, at 18:59, Scott Wood wrote: On 07/17/2013 11:04:08 AM, Alexander Graf wrote: On 17.07.2013, at 17:59, Bhushan Bharat-R65777 wrote: Ah, so we can choose any address range in ccsr space of a PV machine (-M ppce500 / e500plat).

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
Hi Markus, Thanks for your report! I am downloading the ubuntu iso and will try to reproducible it. Could you please enable these tracepoints: kvmmmu/check_mmio_spte kvmmmu/handle_mmio_page_fault kvmmmu/kvm_mmu_invalidate_zap_all_pages kvmmmu/mark_mmio_spte kvm/kvm_mmio kvm/vcpu_match_mmio and

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Markus Trippelsdorf
On 2013.07.18 at 01:25 +0800, Xiao Guangrong wrote: Hi Markus, Thanks for your report! I am downloading the ubuntu iso and will try to reproducible it. Please note that the exact guest doesn't matter. I first noticed the hang when I tried to install Fedora 19 today. Could you please

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Markus Trippelsdorf
On 2013.07.18 at 01:25 +0800, Xiao Guangrong wrote: Hi Markus, Thanks for your report! I am downloading the ubuntu iso and will try to reproducible it. Could you please enable these tracepoints: kvmmmu/check_mmio_spte kvmmmu/handle_mmio_page_fault

[RFC PATCH] kvm-unit-tests : Basic architecture of VMX nested test case

2013-07-17 Thread Arthur Chunqi Li
This is the first version of VMX nested environment. It contains the basic VMX instructions test cases, including VMXON/VMXOFF/VMXPTRLD/ VMXPTRST/VMCLEAR/VMLAUNCH/VMRESUME/VMCALL. This patchalso tests the basic execution routine in VMX nested environment andlet the VM print Hello World to inform

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 08:42:26PM +0200, Markus Trippelsdorf wrote: On 2013.07.18 at 01:25 +0800, Xiao Guangrong wrote: Hi Markus, Thanks for your report! I am downloading the ubuntu iso and will try to reproducible it. Could you please enable these tracepoints:

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
Ouch! The guest is hang when boot from ubuntu iso, i bisected the code and found it is caused by: cad55f1aed000db46dfd1b5706707f33624d8604 is the first bad commit commit cad55f1aed000db46dfd1b5706707f33624d8604 Author: Cornelia Huck cornelia.h...@de.ibm.com Date: Wed Jul 3 16:30:53 2013 +0200

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
Hi, Could you please try this: index 460b9c6..16d1578 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2952,6 +2952,9 @@ static bool page_fault_can_be_fast(u32 error_code) !(error_code PFERR_WRITE_MASK)) return false; + if (error_code

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 09:00:29PM +0200, Markus Trippelsdorf wrote: 10346403 qemu-system-x86-1403 [001] 1451.422260: check_mmio_spte: spte fee00e3f kvm_gen 7ffc8 spte-gen 7ffc7 valid 0 ... Can you trace only this event and record stack information: trace-cmd record -T

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Gleb Natapov
On Thu, Jul 18, 2013 at 03:07:11AM +0800, Xiao Guangrong wrote: Ouch! The guest is hang when boot from ubuntu iso, i bisected the code and found it is caused by: cad55f1aed000db46dfd1b5706707f33624d8604 is the first bad commit commit cad55f1aed000db46dfd1b5706707f33624d8604 Author:

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Markus Trippelsdorf
On 2013.07.18 at 03:27 +0800, Xiao Guangrong wrote: Could you please try this: index 460b9c6..16d1578 100644 --- a/arch/x86/kvm/mmu.c +++ b/arch/x86/kvm/mmu.c @@ -2952,6 +2952,9 @@ static bool page_fault_can_be_fast(u32 error_code) !(error_code PFERR_WRITE_MASK))

Re: commit f8f559422b (KVM: MMU: fast invalidate all mmio sptes) causes hang

2013-07-17 Thread Xiao Guangrong
On Jul 18, 2013, at 3:31 AM, Gleb Natapov g...@redhat.com wrote: On Thu, Jul 18, 2013 at 03:07:11AM +0800, Xiao Guangrong wrote: Ouch! The guest is hang when boot from ubuntu iso, i bisected the code and found it is caused by: cad55f1aed000db46dfd1b5706707f33624d8604 is the first bad

[PULL 0/2] VFIO for qemu-1.6

2013-07-17 Thread Alex Williamson
Hi Anthony, The following changes since commit c3cb8e77804313e1be99b5f28a34a346736707a5: ioport: remove LITTLE_ENDIAN mark for portio (2013-07-12 14:37:47 -0500) are available in the git repository at: git://github.com/awilliam/qemu-vfio.git tags/vfio-for-qemu-1.6 for you to fetch changes

[PULL 2/2] vfio: QEMU-AER: Qemu changes to support AER for VFIO-PCI devices

2013-07-17 Thread Alex Williamson
From: Vijay Mohan Pandarathil vijaymohan.pandarat...@hp.com Add support for error containment when a VFIO device assigned to a KVM guest encounters an error. This is for PCIe devices/drivers that support AER functionality. When the host OS is notified of an error in a device either through the

[PULL 1/2] vfio-pci: VGA quirk update

2013-07-17 Thread Alex Williamson
Turns out all the suspicions for AMD devices were correct, everywhere we read a BAR address that the address matches the config space offset, there's full access to PCI config space. Attempt to generalize some helpers to allow quirks to easily be added for mirrors and windows. Also fill in

Re: windows 2008 falling asleep under KVM

2013-07-17 Thread Peter Kieser
Does the host system support constant_tsc? Check /proc/cpuinfo. It could be that too many ticks are being lost in the guest. -Peter On 2013-07-15 4:54 AM, Nikola Ciprich wrote: Hi, It is sound and _hardware_ not sure why MS separated sound from HW :) OK, I'll check it Try it and see if

[PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-17 Thread Xiao Guangrong
Currently, fast page fault tries to fix mmio page fault when the generation number is invalid (spte.gen != kvm.gen) and returns to guest to retry the fault since it sees the last spte is nonpresent which causes infinity loop It can be triggered only on AMD host since the mmio page fault is

Re: [PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-17 Thread Xiao Guangrong
On 07/18/2013 12:52 PM, Xiao Guangrong wrote: Currently, fast page fault tries to fix mmio page fault when the generation number is invalid (spte.gen != kvm.gen) and returns to guest to retry the fault since it sees the last spte is nonpresent which causes infinity loop It can be triggered

Re: windows 2008 falling asleep under KVM

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 07:22:38PM -0700, Peter Kieser wrote: Does the host system support constant_tsc? Check /proc/cpuinfo. It could be that too many ticks are being lost in the guest. Window2008 will not use TSC as a time source while running as a guest. -Peter On 2013-07-15 4:54 AM,

Re: [PATCH] KVM: MMU: avoid fast page fault fixing mmio page fault

2013-07-17 Thread Gleb Natapov
On Thu, Jul 18, 2013 at 12:52:37PM +0800, Xiao Guangrong wrote: Currently, fast page fault tries to fix mmio page fault when the generation number is invalid (spte.gen != kvm.gen) and returns to guest to retry the fault since it sees the last spte is nonpresent which causes infinity loop It

Re: [RFC PATCH] kvm-unit-tests : Basic architecture of VMX nested test case

2013-07-17 Thread Paolo Bonzini
Il 17/07/2013 20:54, Arthur Chunqi Li ha scritto: +/* entry_sysenter */ +asm( + .align 4, 0x90\n\t + .globl entry_sysenter\n\t + entry_sysenter:\n\t + SAVE_GPR +and $0xf, %rax\n\t +push%rax\n\t push should be wrong here, the first argument

Re: KVM internal error. Suberror: 1, emulation failure

2013-07-17 Thread Gleb Natapov
On Wed, Jul 17, 2013 at 09:16:33AM -0700, Dave Hansen wrote: I'm causing qemu to spew these emulation failure messages until I kill it. The guest kernel being run has been hacked up pretty heavily and is probably either accessing bad physical addresses (above the address ranges in the e820

Re: [PATCH 1/2] KVM: PPC: Book3S HV: Correct tlbie usage

2013-07-17 Thread Aneesh Kumar K.V
Paul Mackerras pau...@samba.org writes: This corrects the usage of the tlbie (TLB invalidate entry) instruction in HV KVM. The tlbie instruction changed between PPC970 and POWER7. On the PPC970, the bit to select large vs. small page is in the instruction, not in the RB register value. This

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Gleb Natapov
On Tue, Jul 16, 2013 at 06:04:34PM -0500, Scott Wood wrote: On 07/16/2013 01:35:55 AM, Gleb Natapov wrote: On Mon, Jul 15, 2013 at 01:17:33PM -0500, Scott Wood wrote: On 07/15/2013 06:30:20 AM, Gleb Natapov wrote: There is no much sense to share hypercalls between architectures. There is

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Alexander Graf
On 17.07.2013, at 13:00, Gleb Natapov wrote: On Tue, Jul 16, 2013 at 06:04:34PM -0500, Scott Wood wrote: On 07/16/2013 01:35:55 AM, Gleb Natapov wrote: On Mon, Jul 15, 2013 at 01:17:33PM -0500, Scott Wood wrote: On 07/15/2013 06:30:20 AM, Gleb Natapov wrote: There is no much sense to share

[PATCH] KVM: PPC: Book3S PR: return appropriate error when allocation fails

2013-07-17 Thread Thadeu Lima de Souza Cascardo
err was overwritten by a previous function call, and checked to be 0. If the following page allocation fails, 0 is going to be returned instead of -ENOMEM. Signed-off-by: Thadeu Lima de Souza Cascardo casca...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_pr.c |5 +++-- 1 files changed, 3

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Alexander Graf
On 17.07.2013, at 17:19, Yoder Stuart-B08248 wrote: -Original Message- From: Alexander Graf [mailto:ag...@suse.de] Sent: Wednesday, July 17, 2013 7:19 AM To: Gleb Natapov Cc: Wood Scott-B07421; Bhushan Bharat-R65777; k...@vger.kernel.org; kvm-ppc@vger.kernel.org; Yoder

RE: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Yoder Stuart-B08248
-Original Message- From: Alexander Graf [mailto:ag...@suse.de] Sent: Wednesday, July 17, 2013 7:19 AM To: Gleb Natapov Cc: Wood Scott-B07421; Bhushan Bharat-R65777; k...@vger.kernel.org; kvm-ppc@vger.kernel.org; Yoder Stuart-B08248; Bhushan Bharat-R65777 Subject: Re: [PATCH 3/5]

RE: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Yoder Stuart-B08248
-Original Message- From: Alexander Graf [mailto:ag...@suse.de] Sent: Wednesday, July 17, 2013 10:21 AM To: Yoder Stuart-B08248 Cc: Wood Scott-B07421; Bhushan Bharat-R65777; k...@vger.kernel.org; kvm-ppc@vger.kernel.org; Gleb Natapov Subject: Re: [PATCH 3/5] booke: define reset

RE: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Bhushan Bharat-R65777
On 17.07.2013, at 13:00, Gleb Natapov wrote: On Tue, Jul 16, 2013 at 06:04:34PM -0500, Scott Wood wrote: On 07/16/2013 01:35:55 AM, Gleb Natapov wrote: On Mon, Jul 15, 2013 at 01:17:33PM -0500, Scott Wood wrote: On 07/15/2013 06:30:20 AM, Gleb Natapov wrote: There is no much sense to

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Alexander Graf
On 17.07.2013, at 18:21, Bhushan Bharat-R65777 wrote: On 17.07.2013, at 13:00, Gleb Natapov wrote: On Tue, Jul 16, 2013 at 06:04:34PM -0500, Scott Wood wrote: On 07/16/2013 01:35:55 AM, Gleb Natapov wrote: On Mon, Jul 15, 2013 at 01:17:33PM -0500, Scott Wood wrote: On 07/15/2013 06:30:20

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Scott Wood
On 07/17/2013 11:04:08 AM, Alexander Graf wrote: On 17.07.2013, at 17:59, Bhushan Bharat-R65777 wrote: Ah, so we can choose any address range in ccsr space of a PV machine (-M ppce500 / e500plat). No, we don't put it in CCSR space. It'd just be orthogonal to CCSR. I'd rather we put it

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Alexander Graf
On 17.07.2013, at 18:59, Scott Wood wrote: On 07/17/2013 11:04:08 AM, Alexander Graf wrote: On 17.07.2013, at 17:59, Bhushan Bharat-R65777 wrote: Ah, so we can choose any address range in ccsr space of a PV machine (-M ppce500 / e500plat). No, we don't put it in CCSR space. It'd just be

Re: [PATCH 3/5] booke: define reset and shutdown hcalls

2013-07-17 Thread Scott Wood
On 07/17/2013 12:05:41 PM, Alexander Graf wrote: On 17.07.2013, at 18:59, Scott Wood wrote: On 07/17/2013 11:04:08 AM, Alexander Graf wrote: On 17.07.2013, at 17:59, Bhushan Bharat-R65777 wrote: Ah, so we can choose any address range in ccsr space of a PV machine (-M ppce500 / e500plat).