Re: [PATCH 2/2] KVM: PPC: Remove page table walk helpers

2015-03-29 Thread Benjamin Herrenschmidt
On Mon, 2015-03-30 at 10:39 +0530, Aneesh Kumar K.V wrote: This patch remove helpers which we had used only once in the code. Limiting page table walk variants help in ensuring that we won't end up with code walking page table with wrong assumptions. Signed-off-by: Aneesh Kumar K.V

Re: [PATCH 2/2] KVM: PPC: Remove page table walk helpers

2015-03-29 Thread Benjamin Herrenschmidt
On Mon, 2015-03-30 at 10:39 +0530, Aneesh Kumar K.V wrote: This patch remove helpers which we had used only once in the code. Limiting page table walk variants help in ensuring that we won't end up with code walking page table with wrong assumptions. Signed-off-by: Aneesh Kumar K.V

[PATCH] kvm: mmu: lazy collapse small sptes into large sptes

2015-03-29 Thread Wanpeng Li
There are two scenarios for the requirement of collapsing small sptes into large sptes. - dirty logging tracks sptes in 4k granularity, so large sptes are splitted, the large sptes will be reallocated in the destination machine and the guest in the source machine will be destroyed when live

[PATCH 1/2] KVM: PPC: Use READ_ONCE when dereferencing pte_t pointer

2015-03-29 Thread Aneesh Kumar K.V
pte can get updated from other CPUs as part of multiple activities like THP split, huge page collapse, unmap. We need to make sure we don't reload the pte value again and again for different checks. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- Note: This is posted

[PATCH 1/2] KVM: PPC: Use READ_ONCE when dereferencing pte_t pointer

2015-03-29 Thread Aneesh Kumar K.V
pte can get updated from other CPUs as part of multiple activities like THP split, huge page collapse, unmap. We need to make sure we don't reload the pte value again and again for different checks. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- Note: This is posted

[PATCH 2/2] KVM: PPC: Remove page table walk helpers

2015-03-29 Thread Aneesh Kumar K.V
This patch remove helpers which we had used only once in the code. Limiting page table walk variants help in ensuring that we won't end up with code walking page table with wrong assumptions. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/pgtable.h

RE: [v3 24/26] KVM: Update Posted-Interrupts Descriptor when vCPU is blocked

2015-03-29 Thread Wu, Feng
-Original Message- From: Marcelo Tosatti [mailto:mtosa...@redhat.com] Sent: Saturday, March 28, 2015 3:30 AM To: Wu, Feng Cc: h...@zytor.com; t...@linutronix.de; mi...@redhat.com; x...@kernel.org; g...@kernel.org; pbonz...@redhat.com; dw...@infradead.org; j...@8bytes.org;

[PATCH 2/2] KVM: PPC: Remove page table walk helpers

2015-03-29 Thread Aneesh Kumar K.V
This patch remove helpers which we had used only once in the code. Limiting page table walk variants help in ensuring that we won't end up with code walking page table with wrong assumptions. Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/include/asm/pgtable.h

[PATCH 2/2] KVM: x86: Remove redundant definitions

2015-03-29 Thread Nadav Amit
Some constants are redfined in emulate.c. Avoid it. s/SELECTOR_RPL_MASK/SEGMENT_RPL_MASK s/SELECTOR_TI_MASK/SEGMENT_TI_MASK No functional change. Signed-off-by: Nadav Amit na...@cs.technion.ac.il --- arch/x86/include/asm/kvm_host.h | 3 --- arch/x86/kvm/emulate.c | 6 +++---

[PATCH 1/2] KVM: x86: removing redundant eflags bits definitions

2015-03-29 Thread Nadav Amit
The eflags are redefined (using other defines) in emulate.c. Use the definition from processor-flags.h as some mess already started. No functional change. Signed-off-by: Nadav Amit na...@cs.technion.ac.il --- arch/x86/include/asm/kvm_host.h | 2 - arch/x86/kvm/emulate.c | 105

[PATCH 0/2] KVM: x86: Removing redundant definitions from emulator

2015-03-29 Thread Nadav Amit
There are several redundant definitions in processor-flags.h and emulator.c. Slowly, but surely they will get mixed, so removing those of emulator.c seems like a reasonable move (unless I am missing something, e.g., kvm-kmod consideration). Nadav Amit (2): KVM: x86: removing redundant eflags

[PATCH 2/3] KVM: nVMX: add missing checks for address bits beyond physical address width on VM-entry

2015-03-29 Thread Eugene Korenevsky
On each VM-entry CPU should check the following VMCS fields for zero bits beyond physical address width: - APIC-access address - virtual-APIC address - posted-interrupt descriptor address This patch adds these checks required by Intel SDM. Signed-off-by: Eugene Korenevsky ekorenev...@gmail.com

[PATCH 1/3] KVM: x86: optimization: cache physical address width to avoid excessive enumerations of CPUID entries

2015-03-29 Thread Eugene Korenevsky
cpuid_maxphyaddr() which performs lot of memory accesses is called extensively across KVM, especially in nVMX code. This patch adds cached value of maxphyaddr to vcpu.arch to reduce the pressure onto CPU cache and simplify the code of cpuid_maxphyaddr() callers. The cached value is initialized

[PATCH 3/3] KVM: nVMX: nested_vmx_check_msr_switch_controls simplification: remove unnecessary caching of physical address width

2015-03-29 Thread Eugene Korenevsky
After speed-up of cpuid_maxphyaddr() it can be called easily. Now instead of heavy enumeration of CPUID entries it returns cached pre-computed value. It is also inlined now. So caching its result became unnecessary and can be removed. Signed-off-by: Eugene Korenevsky ekorenev...@gmail.com ---