Re: __schedule #DF splat

2014-06-29 Thread Gleb Natapov
On Sat, Jun 28, 2014 at 01:44:31PM +0200, Borislav Petkov wrote: qemu-system-x86-20240 [006] ...1 9406.484134: kvm_page_fault: address 7fffb62ba318 error_code 2 qemu-system-x86-20240 [006] ...1 9406.484136: kvm_inj_exception: #PF (0x2)a kvm injects the #PF into the guest.

[PATCH] KVM: x86: Fix lapic.c debug prints

2014-06-29 Thread Nadav Amit
In two cases lapic.c does not use the apic_debug macro correctly. This patch fixes them. Signed-off-by: Nadav Amit na...@cs.technion.ac.il --- arch/x86/kvm/lapic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index

Re: __schedule #DF splat

2014-06-29 Thread Jan Kiszka
On 2014-06-29 08:46, Gleb Natapov wrote: On Sat, Jun 28, 2014 at 01:44:31PM +0200, Borislav Petkov wrote: qemu-system-x86-20240 [006] ...1 9406.484134: kvm_page_fault: address 7fffb62ba318 error_code 2 qemu-system-x86-20240 [006] ...1 9406.484136: kvm_inj_exception: #PF (0x2)a kvm

Re: __schedule #DF splat

2014-06-29 Thread Gleb Natapov
On Sun, Jun 29, 2014 at 11:56:03AM +0200, Jan Kiszka wrote: On 2014-06-29 08:46, Gleb Natapov wrote: On Sat, Jun 28, 2014 at 01:44:31PM +0200, Borislav Petkov wrote: qemu-system-x86-20240 [006] ...1 9406.484134: kvm_page_fault: address 7fffb62ba318 error_code 2 qemu-system-x86-20240

Re: __schedule #DF splat

2014-06-29 Thread Jan Kiszka
On 2014-06-29 12:24, Gleb Natapov wrote: On Sun, Jun 29, 2014 at 11:56:03AM +0200, Jan Kiszka wrote: On 2014-06-29 08:46, Gleb Natapov wrote: On Sat, Jun 28, 2014 at 01:44:31PM +0200, Borislav Petkov wrote: qemu-system-x86-20240 [006] ...1 9406.484134: kvm_page_fault: address 7fffb62ba318

Re: __schedule #DF splat

2014-06-29 Thread Gleb Natapov
On Sun, Jun 29, 2014 at 12:31:50PM +0200, Jan Kiszka wrote: On 2014-06-29 12:24, Gleb Natapov wrote: On Sun, Jun 29, 2014 at 11:56:03AM +0200, Jan Kiszka wrote: On 2014-06-29 08:46, Gleb Natapov wrote: On Sat, Jun 28, 2014 at 01:44:31PM +0200, Borislav Petkov wrote: qemu-system-x86-20240

Re: __schedule #DF splat

2014-06-29 Thread Jan Kiszka
On 2014-06-29 12:53, Gleb Natapov wrote: On Sun, Jun 29, 2014 at 12:31:50PM +0200, Jan Kiszka wrote: On 2014-06-29 12:24, Gleb Natapov wrote: On Sun, Jun 29, 2014 at 11:56:03AM +0200, Jan Kiszka wrote: On 2014-06-29 08:46, Gleb Natapov wrote: On Sat, Jun 28, 2014 at 01:44:31PM +0200, Borislav

[PATCH 2/6] KVM: PPC: BOOK3S: HV: Deny virtual page class key update via h_protect

2014-06-29 Thread Aneesh Kumar K.V
This makes it consistent with h_enter where we clear the key bits. We also want to use virtual page class key protection mechanism for indicating host page fault. For that we will be using key class index 30 and 31. So prevent the guest from updating key bits until we add proper support for

[PATCH 1/6] KVM: PPC: BOOK3S: HV: Clear hash pte bits from do_h_enter callers

2014-06-29 Thread Aneesh Kumar K.V
We will use this to set HPTE_V_VRMA bit in the later patch. This also make sure we clear the hpte bits only when called via hcall. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 15 +-- arch/powerpc/kvm/book3s_hv_rm_mmu.c |

[PATCH 4/6] KVM: PPC: BOOK3S: HV: Use new functions for mapping/unmapping hpte in host

2014-06-29 Thread Aneesh Kumar K.V
We want to use virtual page class key protection mechanism for indicating a MMIO mapped hpte entry or a guest hpte entry that is swapped out in the host. Those hptes will be marked valid, but have virtual page class key set to 30 or 31. These virtual page class numbers are configured in AMR to

[PATCH 0/6] Use virtual page class key protection mechanism for speeding up guest page fault

2014-06-29 Thread Aneesh Kumar K.V
Hi, With the current code we do an expensive hash page table lookup on every page fault resulting from a missing hash page table entry. A NO_HPTE page fault can happen due to the below reasons: 1) Missing hash pte as per guest. This should be forwarded to the guest 2) MMIO hash pte. The address

[PATCH 5/6] KVM: PPC: BOOK3S: Use hpte_update_in_progress to track invalid hpte during an hpte update

2014-06-29 Thread Aneesh Kumar K.V
As per ISA, we first need to mark hpte invalid (V=0) before we update the hpte lower half bits. With virtual page class key protection mechanism we want to send any fault other than key fault to guest directly without searching the hash page table. But then we can get NO_HPTE fault while we are

[PATCH 6/6] KVM: PPC: BOOK3S: HV: Use virtual page class protection mechanism for host fault and mmio

2014-06-29 Thread Aneesh Kumar K.V
With this patch we use AMR class 30 and 31 for indicating a page fault that should be handled by host. This includes the MMIO access and the page fault resulting from guest RAM swapout in the host. This enables us to forward the fault to guest without doing the expensive hash page table search for

[PATCH] KVM: PPC: BOOK3S: HV: Update compute_tlbie_rb to handle 16MB base page

2014-06-29 Thread Aneesh Kumar K.V
When calculating the lower bits of AVA field, use the shift count based on the base page size. Also add the missing segment size and remove stale comment. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_book3s_64.h | 6 --

[PATCH 3/6] KVM: PPC: BOOK3S: HV: Remove dead code

2014-06-29 Thread Aneesh Kumar K.V
Since we do don't support virtual page class key protection mechanism in the guest, we should not find a keyfault that needs to be forwarded to the guest. So remove the dead code. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 9

Re: [PATCH 0/6] Use virtual page class key protection mechanism for speeding up guest page fault

2014-06-29 Thread Benjamin Herrenschmidt
On Sun, 2014-06-29 at 16:47 +0530, Aneesh Kumar K.V wrote: To achieve the above we use virtual page calss protection mechanism for covering (2) and (3). For both the above case we mark the hpte valid, but associate the page with virtual page class index 30 and 31. The authority mask register

Re: __schedule #DF splat

2014-06-29 Thread Borislav Petkov
On Sun, Jun 29, 2014 at 12:59:30PM +0200, Jan Kiszka wrote: Will see what I can do regarding bisecting. That host is a bit slow (netbook), so it may take a while. Boris will probably beat me in this. Nah, I was about to instrument kvm_multiple_exception() first and am slow anyway so... :-)

Re: __schedule #DF splat

2014-06-29 Thread Jan Kiszka
On 2014-06-29 13:51, Borislav Petkov wrote: On Sun, Jun 29, 2014 at 12:59:30PM +0200, Jan Kiszka wrote: Will see what I can do regarding bisecting. That host is a bit slow (netbook), so it may take a while. Boris will probably beat me in this. Nah, I was about to instrument

Re: __schedule #DF splat

2014-06-29 Thread Borislav Petkov
On Sun, Jun 29, 2014 at 02:22:35PM +0200, Jan Kiszka wrote: OK, looks like I won ;): I gladly let you win. :-P The issue was apparently introduced with KVM: x86: get CPL from SS.DPL (ae9fedc793). Maybe we are not properly saving or restoring this state on SVM since then. I wonder if this

Re: __schedule #DF splat

2014-06-29 Thread Gleb Natapov
On Sun, Jun 29, 2014 at 03:14:43PM +0200, Borislav Petkov wrote: On Sun, Jun 29, 2014 at 02:22:35PM +0200, Jan Kiszka wrote: OK, looks like I won ;): I gladly let you win. :-P The issue was apparently introduced with KVM: x86: get CPL from SS.DPL (ae9fedc793). Maybe we are not properly

Re: __schedule #DF splat

2014-06-29 Thread Borislav Petkov
On Sun, Jun 29, 2014 at 03:14:43PM +0200, Borislav Petkov wrote: I better go and revert that one and check whether it fixes things. Yahaaa, that was some good bisection work Jan! :-) 20 guest restart cycles and all is fine - it used to trigger after 5 max. Phew, we have it right in time

Re: __schedule #DF splat

2014-06-29 Thread Borislav Petkov
On Sun, Jun 29, 2014 at 04:42:47PM +0300, Gleb Natapov wrote: Please do so and let us know. Yep, just did. Reverting ae9fedc793 fixes the issue. reinj:1 means that previous injection failed due to another #PF that happened during the event injection itself This may happen if GDT or fist

Re: __schedule #DF splat

2014-06-29 Thread Gleb Natapov
On Sun, Jun 29, 2014 at 04:01:04PM +0200, Borislav Petkov wrote: On Sun, Jun 29, 2014 at 04:42:47PM +0300, Gleb Natapov wrote: Please do so and let us know. Yep, just did. Reverting ae9fedc793 fixes the issue. reinj:1 means that previous injection failed due to another #PF that

Re: __schedule #DF splat

2014-06-29 Thread Jan Kiszka
On 2014-06-29 16:27, Gleb Natapov wrote: On Sun, Jun 29, 2014 at 04:01:04PM +0200, Borislav Petkov wrote: On Sun, Jun 29, 2014 at 04:42:47PM +0300, Gleb Natapov wrote: Please do so and let us know. Yep, just did. Reverting ae9fedc793 fixes the issue. reinj:1 means that previous injection

Re: __schedule #DF splat

2014-06-29 Thread Jan Kiszka
On 2014-06-29 16:32, Jan Kiszka wrote: On 2014-06-29 16:27, Gleb Natapov wrote: On Sun, Jun 29, 2014 at 04:01:04PM +0200, Borislav Petkov wrote: On Sun, Jun 29, 2014 at 04:42:47PM +0300, Gleb Natapov wrote: Please do so and let us know. Yep, just did. Reverting ae9fedc793 fixes the issue.

[PATCH] KVM: SVM: Fix CPL export via SS.DPL

2014-06-29 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com We import the CPL via SS.DPL since ae9fedc793. However, we fail to export it this way so far. This caused spurious guest crashes, e.g. of Linux when accessing the vmport from guest user space which triggered register saving/restoring to/from host user

Re: [PATCH 0/6] Use virtual page class key protection mechanism for speeding up guest page fault

2014-06-29 Thread Aneesh Kumar K.V
Benjamin Herrenschmidt b...@kernel.crashing.org writes: On Sun, 2014-06-29 at 16:47 +0530, Aneesh Kumar K.V wrote: To achieve the above we use virtual page calss protection mechanism for covering (2) and (3). For both the above case we mark the hpte valid, but associate the page with virtual

Re: [PATCH] KVM: SVM: Fix CPL export via SS.DPL

2014-06-29 Thread Borislav Petkov
On Sun, Jun 29, 2014 at 05:12:43PM +0200, Jan Kiszka wrote: From: Jan Kiszka jan.kis...@siemens.com We import the CPL via SS.DPL since ae9fedc793. However, we fail to export it this way so far. This caused spurious guest crashes, e.g. of Linux when accessing the vmport from guest user space

[PATCH] KVM: nSVM: Do not report CLTS via SVM_EXIT_WRITE_CR0 to L1

2014-06-29 Thread Jan Kiszka
From: Jan Kiszka jan.kis...@siemens.com CLTS only changes TS which is not monitored by selected CR0 interception. So skip any attempt to translate WRITE_CR0 to CR0_SEL_WRITE for this instruction. Signed-off-by: Jan Kiszka jan.kis...@siemens.com --- arch/x86/kvm/svm.c | 3 ++- 1 file changed, 2

Re: [PATCH] KVM: x86: Fix lapic.c debug prints

2014-06-29 Thread Bandan Das
Nadav Amit na...@cs.technion.ac.il writes: In two cases lapic.c does not use the apic_debug macro correctly. This patch fixes them. Signed-off-by: Nadav Amit na...@cs.technion.ac.il --- arch/x86/kvm/lapic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git

Re: [PATCH] KVM: x86: Fix lapic.c debug prints

2014-06-29 Thread Nadav Amit
On 6/30/14, 3:48 AM, Bandan Das wrote: Nadav Amit na...@cs.technion.ac.il writes: In two cases lapic.c does not use the apic_debug macro correctly. This patch fixes them. Signed-off-by: Nadav Amit na...@cs.technion.ac.il --- arch/x86/kvm/lapic.c | 4 ++-- 1 file changed, 2 insertions(+), 2

[questions] about KVM as a Microsoft-compatible hypervisor

2014-06-29 Thread Zhang Haoyu
Hi, Vadim I read the kvm-2012-forum paper KVM as a Microsoft-compatible hypervisor, Any update and other references, please? Thanks, Zhang Haoyu -- 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

Re: [RFC PATCH 1/1] Move two pinned pages to non-movable node in kvm.

2014-06-29 Thread Tang Chen
On 06/21/2014 04:39 AM, Marcelo Tosatti wrote: On Fri, Jun 20, 2014 at 05:31:46PM -0300, Marcelo Tosatti wrote: IIRC your shadow page pinning patch series support flushing of ptes by mmu notifier by forcing MMU reload and, as a result, faulting in of pinned pages during next entry. Your patch

Re: Poor performance with virtio network driver on windows 2008 R2 on KVM

2014-06-29 Thread Peter Kieser
Hi JR, I mostly did this to stop the freezing. I'm back to troubleshoot this issue, since the e1000 driver performs worse with Linux 3.10 and qemu 2.0 now. One thing that did help a bit, was disabling vhost-net zero copy, but the latency and packet loss is still there (but not as much.) Did

RE: [PATCH 2/2] KVM : powerpc/booke: Allow debug interrupt injection to guest

2014-06-29 Thread bharat.bhus...@freescale.com
-Original Message- From: Wood Scott-B07421 Sent: Friday, June 27, 2014 11:53 PM To: Bhushan Bharat-R65777 Cc: ag...@suse.de; kvm-...@vger.kernel.org; kvm@vger.kernel.org Subject: Re: [PATCH 2/2] KVM : powerpc/booke: Allow debug interrupt injection to guest On Fri, 2014-06-27

[PATCH 1/6] KVM: PPC: BOOK3S: HV: Clear hash pte bits from do_h_enter callers

2014-06-29 Thread Aneesh Kumar K.V
We will use this to set HPTE_V_VRMA bit in the later patch. This also make sure we clear the hpte bits only when called via hcall. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 15 +-- arch/powerpc/kvm/book3s_hv_rm_mmu.c |

[PATCH 0/6] Use virtual page class key protection mechanism for speeding up guest page fault

2014-06-29 Thread Aneesh Kumar K.V
Hi, With the current code we do an expensive hash page table lookup on every page fault resulting from a missing hash page table entry. A NO_HPTE page fault can happen due to the below reasons: 1) Missing hash pte as per guest. This should be forwarded to the guest 2) MMIO hash pte. The address

[PATCH 4/6] KVM: PPC: BOOK3S: HV: Use new functions for mapping/unmapping hpte in host

2014-06-29 Thread Aneesh Kumar K.V
We want to use virtual page class key protection mechanism for indicating a MMIO mapped hpte entry or a guest hpte entry that is swapped out in the host. Those hptes will be marked valid, but have virtual page class key set to 30 or 31. These virtual page class numbers are configured in AMR to

[PATCH 6/6] KVM: PPC: BOOK3S: HV: Use virtual page class protection mechanism for host fault and mmio

2014-06-29 Thread Aneesh Kumar K.V
With this patch we use AMR class 30 and 31 for indicating a page fault that should be handled by host. This includes the MMIO access and the page fault resulting from guest RAM swapout in the host. This enables us to forward the fault to guest without doing the expensive hash page table search for

[PATCH 3/6] KVM: PPC: BOOK3S: HV: Remove dead code

2014-06-29 Thread Aneesh Kumar K.V
Since we do don't support virtual page class key protection mechanism in the guest, we should not find a keyfault that needs to be forwarded to the guest. So remove the dead code. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_64_mmu_hv.c | 9

[PATCH 2/6] KVM: PPC: BOOK3S: HV: Deny virtual page class key update via h_protect

2014-06-29 Thread Aneesh Kumar K.V
This makes it consistent with h_enter where we clear the key bits. We also want to use virtual page class key protection mechanism for indicating host page fault. For that we will be using key class index 30 and 31. So prevent the guest from updating key bits until we add proper support for

[PATCH] KVM: PPC: BOOK3S: HV: Update compute_tlbie_rb to handle 16MB base page

2014-06-29 Thread Aneesh Kumar K.V
When calculating the lower bits of AVA field, use the shift count based on the base page size. Also add the missing segment size and remove stale comment. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_book3s_64.h | 6 --

[PATCH 5/6] KVM: PPC: BOOK3S: Use hpte_update_in_progress to track invalid hpte during an hpte update

2014-06-29 Thread Aneesh Kumar K.V
As per ISA, we first need to mark hpte invalid (V=0) before we update the hpte lower half bits. With virtual page class key protection mechanism we want to send any fault other than key fault to guest directly without searching the hash page table. But then we can get NO_HPTE fault while we are

KVM usb audio passthrough issue

2014-06-29 Thread Ignace
All, I am trying to setup a multiroom tuner. I am trying to accomplish this with KVM. The setup: Linux mint 16 Mate 64bit as host. I installed KVM and virt-manager by the default repositories. The guest I am using : ubuntu 14.04 (1cpu and 1 gig ram) Via virt-manager I have put my USB headset on

RE: [PATCH 2/2] KVM : powerpc/booke: Allow debug interrupt injection to guest

2014-06-29 Thread bharat.bhus...@freescale.com
-Original Message- From: Wood Scott-B07421 Sent: Friday, June 27, 2014 11:53 PM To: Bhushan Bharat-R65777 Cc: ag...@suse.de; kvm-ppc@vger.kernel.org; k...@vger.kernel.org Subject: Re: [PATCH 2/2] KVM : powerpc/booke: Allow debug interrupt injection to guest On Fri, 2014-06-27