[PATCH] KVM-async_pf: Delete an unnecessary check before the function call "kmem_cache_destroy"

2015-11-15 Thread SF Markus Elfring
From: Markus Elfring Date: Sun, 15 Nov 2015 10:40:36 +0100 The kmem_cache_destroy() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software.

[PATCH] kvm/vmx: EPTP switching test

2015-11-15 Thread Michael S. Tsirkin
This patch adds a new parameter: eptp_switching_test, which enables testing EPT switching on VMX if supported by hardware. All EPT entries are initialized to the same value so this adds no useful functionality by itself, but can be used to test VMFUNC performance, and serve as a basis for future

[Bug 107921] New: Regression with KVM virtual machine using VFIO for PCI passthrough.

2015-11-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107921 Bug ID: 107921 Summary: Regression with KVM virtual machine using VFIO for PCI passthrough. Product: Virtualization Version: unspecified Kernel Version: 4.2 Hardware:

[Bug 107921] Regression with KVM virtual machine using VFIO for PCI passthrough.

2015-11-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107921 --- Comment #2 from Jasen Borisov --- Created attachment 193061 --> https://bugzilla.kernel.org/attachment.cgi?id=193061=edit Kernel config for my 4.2.6 test build. -- You are receiving this mail because: You are watching

[Bug 107921] Regression with KVM virtual machine using VFIO for PCI passthrough.

2015-11-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107921 --- Comment #4 from Jasen Borisov --- Created attachment 193081 --> https://bugzilla.kernel.org/attachment.cgi?id=193081=edit `dmesg` output from 4.1.13. -- You are receiving this mail because: You are watching the

[Bug 107921] Regression with KVM virtual machine using VFIO for PCI passthrough.

2015-11-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107921 --- Comment #1 from Jasen Borisov --- Created attachment 193051 --> https://bugzilla.kernel.org/attachment.cgi?id=193051=edit Kernel config for my 4.1.13 test build. -- You are receiving this mail because: You are watching

[Bug 107921] Regression with KVM virtual machine using VFIO for PCI passthrough.

2015-11-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107921 --- Comment #3 from Jasen Borisov --- Created attachment 193071 --> https://bugzilla.kernel.org/attachment.cgi?id=193071=edit Kernel config for my 4.3.0 test build. -- You are receiving this mail because: You are watching

[Bug 107921] Regression with KVM virtual machine using VFIO for PCI passthrough.

2015-11-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107921 --- Comment #6 from Jasen Borisov --- Created attachment 193101 --> https://bugzilla.kernel.org/attachment.cgi?id=193101=edit `dmesg` output from 4.3.0 -- You are receiving this mail because: You are watching the assignee

[Bug 107921] Regression with KVM virtual machine using VFIO for PCI passthrough.

2015-11-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107921 --- Comment #5 from Jasen Borisov --- Created attachment 193091 --> https://bugzilla.kernel.org/attachment.cgi?id=193091=edit `dmesg` output from 4.2.6 -- You are receiving this mail because: You are watching the assignee

[Bug 107921] Regression with KVM virtual machine using VFIO for PCI passthrough.

2015-11-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107921 --- Comment #7 from Jasen Borisov --- Created attachment 193111 --> https://bugzilla.kernel.org/attachment.cgi?id=193111=edit libvirt virtual machine domain configuration -- You are receiving this mail because: You are

[Bug 107921] Regression with KVM virtual machine using VFIO for PCI passthrough.

2015-11-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107921 --- Comment #8 from Jasen Borisov --- Created attachment 193121 --> https://bugzilla.kernel.org/attachment.cgi?id=193121=edit `lspci -vv` output from the host system -- You are receiving this mail because: You are watching

Re: [PATCH 05/10] KVM: x86: MMU: Use for_each_rmap_spte macro instead of pte_list_walk()

2015-11-15 Thread Marcelo Tosatti
On Fri, Nov 13, 2015 at 07:47:28PM -0200, Marcelo Tosatti wrote: > On Thu, Nov 12, 2015 at 08:52:45PM +0900, Takuya Yoshikawa wrote: > > kvm_mmu_mark_parents_unsync() alone uses pte_list_walk(), witch does > > nearly the same as the for_each_rmap_spte macro. The only difference > > is that

[PATCH] KVM: powerpc: kvmppc_visible_gpa can be boolean

2015-11-15 Thread Yaowei Bai
In another patch kvm_is_visible_gfn is maken return bool due to this function only returns zero or one as its return value, let's also make kvmppc_visible_gpa return bool to keep consistent. No functional change. Signed-off-by: Yaowei Bai ---

[Bug 107561] 4.2 breaks PCI passthrough in QEMU/KVM

2015-11-15 Thread bugzilla-daemon
https://bugzilla.kernel.org/show_bug.cgi?id=107561 bre...@gmail.com changed: What|Removed |Added CC||bre...@gmail.com --- Comment #3 from

Re: [PATCH 1/2] KVM: kvm_is_visible_gfn can be boolean

2015-11-15 Thread Yaowei Bai
On Sat, Nov 14, 2015 at 06:07:51PM +0800, Amos Jianjun Kong wrote: > On Sat, Nov 14, 2015 at 11:21 AM, Yaowei Bai > wrote: > > This patch makes kvm_is_visible_gfn return bool due to this particular > > function only using either one or zero as its return value. > >

[PATCH] KVM: powerpc: kvmppc_visible_gpa can be boolean

2015-11-15 Thread Yaowei Bai
In another patch kvm_is_visible_gfn is maken return bool due to this function only returns zero or one as its return value, let's also make kvmppc_visible_gpa return bool to keep consistent. No functional change. Signed-off-by: Yaowei Bai ---

Re: [Qemu-devel] [PATCH v3 1/3] target-i386: add a subsection for migrating vcpu's TSC rate

2015-11-15 Thread Haozhong Zhang
On 11/13/15 13:21, Eduardo Habkost wrote: > On Fri, Nov 13, 2015 at 10:23:54AM +0800, Haozhong Zhang wrote: > > On 11/11/15 22:27, Haozhong Zhang wrote: > > > On 11/11/15 12:16, Eduardo Habkost wrote: > > [...] > > > > > diff --git a/hw/i386/pc_q35.c b/hw/i386/pc_q35.c > > > > > index

Re: [PATCH 05/10] KVM: x86: MMU: Use for_each_rmap_spte macro instead of pte_list_walk()

2015-11-15 Thread Takuya Yoshikawa
On 2015/11/14 18:20, Marcelo Tosatti wrote: The actual issue is this: a higher level page that had, under its children, no out of sync pages, now, due to your addition, a child that is unsync: initial state: level1 final state: level1 -x-> level2 -x-> level3 Where -x-> are

Re: [PATCH 06/10] KVM: x86: MMU: Consolidate WARN_ON/BUG_ON checks for reverse-mapped sptes

2015-11-15 Thread Takuya Yoshikawa
On 2015/11/14 7:08, Marcelo Tosatti wrote: On Thu, Nov 12, 2015 at 08:53:43PM +0900, Takuya Yoshikawa wrote: At some call sites of rmap_get_first() and rmap_get_next(), BUG_ON is placed right after the call to detect unrelated sptes which must not be found in the reverse-mapping list. Move

RE: [PATCH] KVM: x86: Add lowest-priority support for vt-d posted-interrupts

2015-11-15 Thread Wu, Feng
Hi Paolo, Any comments about this patch, thanks in advance! Thanks, Feng > -Original Message- > From: Wu, Feng > Sent: Monday, November 9, 2015 10:47 AM > To: pbonz...@redhat.com > Cc: kvm@vger.kernel.org; linux-ker...@vger.kernel.org; Wu, Feng > > Subject: [PATCH]

Re: [PATCH v1 2/2] dma-mapping-common: add DMA attribute - DMA_ATTR_IOMMU_BYPASS

2015-11-15 Thread Benjamin Serebrin
We looked into Intel IOMMU performance a while ago and learned a few useful things. We generally did a parallel 200 thread TCP_RR test, as this churns through mappings quickly and uses all available cores. First, the main bottleneck was software performance[1]. This study preceded the recent

[kvm-unit-tests] x86: pkeys: add test for PKEYS

2015-11-15 Thread Huaitong Han
Signed-off-by: Huaitong Han diff --git a/config/config-x86-common.mak b/config/config-x86-common.mak index c2f9908..2ef98cc 100644 --- a/config/config-x86-common.mak +++ b/config/config-x86-common.mak @@ -36,7 +36,8 @@ tests-common = $(TEST_DIR)/vmexit.flat

[PATCH V2 0/7] KVM, pkeys: add memory protection-key support

2015-11-15 Thread Huaitong Han
Changes in v2: *Add pku.c for kvm-unit-tests. *Optimize permission_fault codes for patch4. *Delete is_long_mode and PK for patch5. *Squash cpuid and cr4 patches. The protection-key feature provides an additional mechanism by which IA-32e paging controls access to usermode addresses. Hardware

[kvm-unit-tests] x86: smap: add smap check to unittests.cfg

2015-11-15 Thread Huaitong Han
Signed-off-by: Huaitong Han diff --git a/x86/unittests.cfg b/x86/unittests.cfg index 14e36a4..6d3dc89 100644 --- a/x86/unittests.cfg +++ b/x86/unittests.cfg @@ -72,6 +72,10 @@ groups = vmexit file = access.flat arch = x86_64 +[smap] +file = smap.flat +extra_params =

[PATCH V2 5/7] KVM, pkeys: Add pkeys support for gva_to_gpa funcions

2015-11-15 Thread Huaitong Han
This patch adds pkeys support for gva_to_gpa funcions. Signed-off-by: Huaitong Han diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 7a84b83..bd942f3 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -3960,6 +3960,7 @@ gpa_t

[PATCH V2 3/7] KVM, pkeys: update memeory permission bitmask for pkeys

2015-11-15 Thread Huaitong Han
Pkeys define a new status bit in the PFEC. PFEC.PK (bit 5), if some conditions is true, the fault is considered as a PKU violation. This patch updates memeory permission bitmask for pkeys. Signed-off-by: Huaitong Han diff --git a/arch/x86/include/asm/kvm_host.h

[PATCH V2 7/7] KVM, pkeys: disable PKU feature without ept

2015-11-15 Thread Huaitong Han
This patch disables CPUID:PKU without ept. Signed-off-by: Huaitong Han diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c index ece687b..e1113ae 100644 --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -447,6 +447,8 @@ static inline int __do_cpuid_ent(struct

[PATCH V2 0/3] target-i386: add memory protection-key support

2015-11-15 Thread Huaitong Han
Changes in v2: *Fix memcpy error for xsave state. *Fix TCG_7_0_ECX_FEATURES to 0. *Make subjects more readable. The protection-key feature provides an additional mechanism by which IA-32e paging controls access to usermode addresses. Hardware support for protection keys for user pages is

[PATCH V2 1/7] KVM, pkeys: expose CPUID/CR4 to guest

2015-11-15 Thread Huaitong Han
This patch exposes CPUID/CR4 to guest. X86_FEATURE_PKU is referred to as "PKU" in the hardware documentation: CPUID.7.0.ECX[3]:PKU. X86_FEATURE_OSPKE is software support for pkeys, enumerated with CPUID.7.0.ECX[4]:OSPKE, and it reflects the setting of CR4.PKE(bit 22). Signed-off-by: Huaitong Han

[PATCH V2 2/3] target-i386: add pkeys support for xsave state handling

2015-11-15 Thread Huaitong Han
This patch adds pkeys support for xsave state handling. Signed-off-by: Huaitong Han diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 2ff73ee..f65f785 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -487,6 +487,8 @@ static const ExtSaveArea

[PATCH V2 1/3] target-i386: add pkeys support for cpuid handling

2015-11-15 Thread Huaitong Han
This patch adds pkeys support for cpuid handling. Signed-off-by: Huaitong Han diff --git a/target-i386/cpu.c b/target-i386/cpu.c index 4d1b085..2ff73ee 100644 --- a/target-i386/cpu.c +++ b/target-i386/cpu.c @@ -264,6 +264,17 @@ static const char

[PATCH V2 4/7] KVM, pkeys: add pkeys support for permission_fault logic

2015-11-15 Thread Huaitong Han
Protection keys define a new 4-bit protection key field (PKEY) in bits 62:59 of leaf entries of the page tables, the PKEY is an index to PKRU register(16 domains), every domain has 2 bits(write disable bit, access disable bit). Static logic has been produced in update_permission_bitmask, dynamic

[PATCH V2 2/7] KVM, pkeys: disable pkeys for guests in non-paging mode

2015-11-15 Thread Huaitong Han
Pkeys is disabled if CPU is in non-paging mode in hardware. However KVM always uses paging mode to emulate guest non-paging, mode with TDP. To emulate this behavior, pkeys needs to be manually disabled when guest switches to non-paging mode. Signed-off-by: Huaitong Han

[PATCH V2 6/7] KVM, pkeys: add pkeys support for xsave state

2015-11-15 Thread Huaitong Han
This patch adds pkeys support for xsave state. Signed-off-by: Huaitong Han diff --git a/arch/x86/kvm/x86.h b/arch/x86/kvm/x86.h index f2afa5f..0f71d5d 100644 --- a/arch/x86/kvm/x86.h +++ b/arch/x86/kvm/x86.h @@ -182,7 +182,8 @@ bool

[PATCH V2 3/3] target-i386: add pkeys support for vm migration

2015-11-15 Thread Huaitong Han
This patch adds pkeys support for vm migration. Signed-off-by: Huaitong Han diff --git a/target-i386/machine.c b/target-i386/machine.c index a0df64b..1b190c7 100644 --- a/target-i386/machine.c +++ b/target-i386/machine.c @@ -725,6 +725,26 @@ static const