Re: [PATCH v3 03/13] nEPT: Add EPT tables support to paging_tmpl.h

2013-05-22 Thread Gleb Natapov
On Tue, May 21, 2013 at 03:26:18PM -0700, Nakajima, Jun wrote: On Tue, May 21, 2013 at 4:05 AM, Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com wrote: On 05/21/2013 05:01 PM, Gleb Natapov wrote: On Tue, May 21, 2013 at 04:30:13PM +0800, Xiao Guangrong wrote: @@ -772,6 +810,7 @@ static

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Gleb Natapov
On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: On Tue, May 21, 2013 at 11:39:03AM +0300, Gleb Natapov wrote: Any pages with stale information will be zapped by kvm_mmu_zap_all(). When that happens, page faults will take place which will automatically use the new

Re: [RFC PATCH v2 2/2] add support for Hyper-V invariant TSC

2013-05-22 Thread Vadim Rozenfeld
- Original Message - From: Marcelo Tosatti mtosa...@redhat.com To: Vadim Rozenfeld vroze...@redhat.com Cc: kvm@vger.kernel.org, g...@redhat.com, p...@dlh.net Sent: Wednesday, May 22, 2013 10:50:46 AM Subject: Re: [RFC PATCH v2 2/2] add support for Hyper-V invariant TSC On Sun, May 19,

Re: [RFC PATCH v2 1/2] add support for Hyper-V reference time counter

2013-05-22 Thread Vadim Rozenfeld
- Original Message - From: Marcelo Tosatti mtosa...@redhat.com To: Vadim Rozenfeld vroze...@redhat.com Cc: kvm@vger.kernel.org, g...@redhat.com, p...@dlh.net Sent: Wednesday, May 22, 2013 10:46:14 AM Subject: Re: [RFC PATCH v2 1/2] add support for Hyper-V reference time counter On Sun,

Re: [PATCH v4 21/32] arm64: KVM: Build system integration

2013-05-22 Thread Catalin Marinas
On Tue, May 21, 2013 at 05:09:47PM +0100, Paolo Bonzini wrote: - Messaggio originale - Da: Catalin Marinas catalin.mari...@arm.com A: Marc Zyngier marc.zyng...@arm.com Cc: linux-arm-ker...@lists.infradead.org, kvm...@lists.cs.columbia.edu, kvm@vger.kernel.org, Will Deacon

Re: [PATCH v4 21/32] arm64: KVM: Build system integration

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 10:42, Catalin Marinas ha scritto: On Tue, May 21, 2013 at 05:09:47PM +0100, Paolo Bonzini wrote: - Messaggio originale - Da: Catalin Marinas catalin.mari...@arm.com A: Marc Zyngier marc.zyng...@arm.com Cc: linux-arm-ker...@lists.infradead.org,

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Xiao Guangrong
On 05/22/2013 02:34 PM, Gleb Natapov wrote: On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: On Tue, May 21, 2013 at 11:39:03AM +0300, Gleb Natapov wrote: Any pages with stale information will be zapped by kvm_mmu_zap_all(). When that happens, page faults will take place which

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Gleb Natapov
On Wed, May 22, 2013 at 04:46:04PM +0800, Xiao Guangrong wrote: On 05/22/2013 02:34 PM, Gleb Natapov wrote: On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: On Tue, May 21, 2013 at 11:39:03AM +0300, Gleb Natapov wrote: Any pages with stale information will be zapped by

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Arnd Bergmann
On Thursday 16 May 2013, Michael S. Tsirkin wrote: This improves the might_fault annotations used by uaccess routines: 1. The only reason uaccess routines might sleep is if they fault. Make this explicit for all architectures. 2. Accesses (e.g through socket ops) to kernel memory

Re: [PATCH] kvm: add detail error message when fail to add ioeventfd

2013-05-22 Thread Stefan Hajnoczi
On Wed, May 22, 2013 at 12:57:35PM +0800, Amos Kong wrote: I try to hotplug 28 * 8 multiple-function devices to guest with old host kernel, ioeventfds in host kernel will be exhausted, then qemu fails to allocate ioeventfds for blk/nic devices. It's better to add detail error here.

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Xiao Guangrong
On 05/22/2013 04:54 PM, Gleb Natapov wrote: On Wed, May 22, 2013 at 04:46:04PM +0800, Xiao Guangrong wrote: On 05/22/2013 02:34 PM, Gleb Natapov wrote: On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: On Tue, May 21, 2013 at 11:39:03AM +0300, Gleb Natapov wrote: Any pages with

Re: [PATCH v2 10/10] kernel: might_fault does not imply might_sleep

2013-05-22 Thread Michael S. Tsirkin
On Tue, May 21, 2013 at 01:57:34PM +0200, Peter Zijlstra wrote: On Sun, May 19, 2013 at 12:35:26PM +0300, Michael S. Tsirkin wrote: --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -198,7 +198,6 @@ void might_fault(void); #else static inline void

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: On Thursday 16 May 2013, Michael S. Tsirkin wrote: This improves the might_fault annotations used by uaccess routines: 1. The only reason uaccess routines might sleep is if they fault. Make this explicit for all

Re: provide vhost thread per virtqueue for forwarding scenario

2013-05-22 Thread Zang Hongyong
On 2013/5/20 15:43, Michael S. Tsirkin wrote: On Mon, May 20, 2013 at 02:11:19AM +, Qinchuanyu wrote: Vhost thread provide both tx and rx ability for virtio-net. In the forwarding scenarios, tx and rx share the vhost thread, and throughput is limited by single thread. So I did a patch for

Re: provide vhost thread per virtqueue for forwarding scenario

2013-05-22 Thread Jason Wang
On 05/22/2013 05:59 PM, Zang Hongyong wrote: On 2013/5/20 15:43, Michael S. Tsirkin wrote: On Mon, May 20, 2013 at 02:11:19AM +, Qinchuanyu wrote: Vhost thread provide both tx and rx ability for virtio-net. In the forwarding scenarios, tx and rx share the vhost thread, and throughput is

Re: provide vhost thread per virtqueue for forwarding scenario

2013-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 05:59:03PM +0800, Zang Hongyong wrote: On 2013/5/20 15:43, Michael S. Tsirkin wrote: On Mon, May 20, 2013 at 02:11:19AM +, Qinchuanyu wrote: Vhost thread provide both tx and rx ability for virtio-net. In the forwarding scenarios, tx and rx share the vhost thread,

[nVMX ] A couple more tests

2013-05-22 Thread Kashyap Chamarthy
Heya, So, Gleb suggested (thank you) to try kvm unit tests in L1, here's some (incomprehensive) detail. I also ran a defconfig in a 20 loop iteration (in L2) where subsequent runs after the first one are from page cache. 1. A couple of unit tests w/ 64 bit compiled:

Re: [PATCH v2 10/10] kernel: might_fault does not imply might_sleep

2013-05-22 Thread Peter Zijlstra
On Wed, May 22, 2013 at 12:47:09PM +0300, Michael S. Tsirkin wrote: +static inline bool __can_fault(void) +{ + /* +* Some code (nfs/sunrpc) uses socket ops on kernel memory while +* holding the mmap_sem, this is safe because kernel memory doesn't +* get paged out,

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Peter Zijlstra
On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Calling might_fault() for every __get_user/__put_user is rather expensive because it turns what should be a single instruction (plus fixup) into an external function call. We could hide it all behind CONFIG_DEBUG_ATOMIC_SLEEP just

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 12:19:16PM +0200, Peter Zijlstra wrote: On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Calling might_fault() for every __get_user/__put_user is rather expensive because it turns what should be a single instruction (plus fixup) into an external

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Peter Zijlstra
On Wed, May 22, 2013 at 02:07:29PM +0300, Michael S. Tsirkin wrote: On Wed, May 22, 2013 at 12:19:16PM +0200, Peter Zijlstra wrote: On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Calling might_fault() for every __get_user/__put_user is rather expensive because it turns

[PATCH 1/1] KVM: add kvm_para_available to asm-generic/kvm_para.h

2013-05-22 Thread James Hogan
According to include/uapi/linux/kvm_para.h architectures should define kvm_para_available, so add an implementation to asm-generic/kvm_para.h which just returns false. Signed-off-by: James Hogan james.ho...@imgtec.com Cc: Marcelo Tosatti mtosa...@redhat.com Cc: Gleb Natapov g...@redhat.com Cc:

Re: [PATCH v4 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-22 Thread Gleb Natapov
On Tue, May 21, 2013 at 01:54:49PM -0700, David Daney wrote: From: David Daney david.da...@cavium.com The initial patch set implementing MIPS KVM does not handle 64-bit guests or use of the FPU. This patch set corrects these ABI issues, and does some very minor clean up. Sanjay, is this

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Gleb Natapov
On Wed, May 22, 2013 at 05:41:10PM +0800, Xiao Guangrong wrote: On 05/22/2013 04:54 PM, Gleb Natapov wrote: On Wed, May 22, 2013 at 04:46:04PM +0800, Xiao Guangrong wrote: On 05/22/2013 02:34 PM, Gleb Natapov wrote: On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: On Tue,

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Russell King - ARM Linux
On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Given the most commonly used functions and a couple of architectures I'm familiar with, these are the ones that currently call might_fault() x86-32 x86-64 arm arm64 powerpc s390generic

Re: [PATCH] kvm: add detail error message when fail to add ioeventfd

2013-05-22 Thread Amos Kong
On Wed, May 22, 2013 at 11:32:27AM +0200, Stefan Hajnoczi wrote: On Wed, May 22, 2013 at 12:57:35PM +0800, Amos Kong wrote: I try to hotplug 28 * 8 multiple-function devices to guest with old host kernel, ioeventfds in host kernel will be exhausted, then qemu fails to allocate ioeventfds

Re: [PATCH v2 07/10] powerpc: uaccess s/might_sleep/might_fault/

2013-05-22 Thread Arnd Bergmann
On Thursday 16 May 2013, Michael S. Tsirkin wrote: @@ -178,7 +178,7 @@ do { \ long __pu_err; \ __typeof__(*(ptr)) __user *__pu_addr = (ptr); \ if

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Arnd Bergmann
On Wednesday 22 May 2013, Russell King - ARM Linux wrote: On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Given the most commonly used functions and a couple of architectures I'm familiar with, these are the ones that currently call might_fault()

Re: [PATCH v2 07/10] powerpc: uaccess s/might_sleep/might_fault/

2013-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 03:59:01PM +0200, Arnd Bergmann wrote: On Thursday 16 May 2013, Michael S. Tsirkin wrote: @@ -178,7 +178,7 @@ do { \ long __pu_err; \

Re: [PATCH v2 00/10] uaccess: better might_sleep/might_fault behavior

2013-05-22 Thread Michael S. Tsirkin
On Wed, May 22, 2013 at 04:04:48PM +0200, Arnd Bergmann wrote: On Wednesday 22 May 2013, Russell King - ARM Linux wrote: On Wed, May 22, 2013 at 11:25:36AM +0200, Arnd Bergmann wrote: Given the most commonly used functions and a couple of architectures I'm familiar with, these are the

Re: [RFC PATCH v2 1/2] add support for Hyper-V reference time counter

2013-05-22 Thread Marcelo Tosatti
On Wed, May 22, 2013 at 06:38:47AM +0300, Gleb Natapov wrote: On Wed, May 22, 2013 at 12:32:57AM -0300, Marcelo Tosatti wrote: On Wed, May 22, 2013 at 06:28:47AM +0300, Gleb Natapov wrote + case HV_X64_MSR_TIME_REF_COUNT: r = true; break;

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Marcelo Tosatti
On Wed, May 22, 2013 at 09:34:13AM +0300, Gleb Natapov wrote: On Tue, May 21, 2013 at 10:33:30PM -0300, Marcelo Tosatti wrote: On Tue, May 21, 2013 at 11:39:03AM +0300, Gleb Natapov wrote: Any pages with stale information will be zapped by kvm_mmu_zap_all(). When that happens, page

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Xiao Guangrong
On 05/22/2013 09:17 PM, Gleb Natapov wrote: On Wed, May 22, 2013 at 05:41:10PM +0800, Xiao Guangrong wrote: On 05/22/2013 04:54 PM, Gleb Natapov wrote: On Wed, May 22, 2013 at 04:46:04PM +0800, Xiao Guangrong wrote: On 05/22/2013 02:34 PM, Gleb Natapov wrote: On Tue, May 21, 2013 at

Re: [PATCH v6 3/7] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Gleb Natapov
On Wed, May 22, 2013 at 11:25:13PM +0800, Xiao Guangrong wrote: On 05/22/2013 09:17 PM, Gleb Natapov wrote: On Wed, May 22, 2013 at 05:41:10PM +0800, Xiao Guangrong wrote: On 05/22/2013 04:54 PM, Gleb Natapov wrote: On Wed, May 22, 2013 at 04:46:04PM +0800, Xiao Guangrong wrote: On

Re: [PATCH v4 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-22 Thread Sanjay Lal
On May 22, 2013, at 5:54 AM, Gleb Natapov wrote: On Tue, May 21, 2013 at 01:54:49PM -0700, David Daney wrote: From: David Daney david.da...@cavium.com The initial patch set implementing MIPS KVM does not handle 64-bit guests or use of the FPU. This patch set corrects these ABI issues,

Re: [PATCH v4 5/6] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_ONE_REG

2013-05-22 Thread Sanjay Lal
On May 21, 2013, at 1:54 PM, David Daney wrote: From: David Daney david.da...@cavium.com Because not all 256 CP0 registers are ever implemented, we need a different method of manipulating them. Use the KVM_SET_ONE_REG/KVM_GET_ONE_REG mechanism. Code related to implementing

Re: [PATCH v4 5/6] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_ONE_REG

2013-05-22 Thread David Daney
On 05/22/2013 10:44 AM, Sanjay Lal wrote: On May 21, 2013, at 1:54 PM, David Daney wrote: From: David Daney david.da...@cavium.com Because not all 256 CP0 registers are ever implemented, we need a different method of manipulating them. Use the KVM_SET_ONE_REG/KVM_GET_ONE_REG mechanism.

Re: [PATCH -next] ia64, metag: Do not export min_low_pfn in arch-specific code

2013-05-22 Thread Ralf Baechle
On Sun, Apr 28, 2013 at 11:24:35AM +0100, James Hogan wrote: On 27 April 2013 19:20, Geert Uytterhoeven ge...@linux-m68k.org wrote: As of commit 787dcbe6984b3638e94f60d807dcb51bb8a07211 (MIPS: Export symbols used by KVM/MIPS module), min_low_pfn is already exported by the generic

[PATCH v5 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-22 Thread David Daney
From: David Daney david.da...@cavium.com The initial patch set implementing MIPS KVM does not handle 64-bit guests or use of the FPU. This patch set corrects these ABI issues, and does some very minor clean up. Changes from v4: No code change, just keep more of the code in

[PATCH v5 2/6] mips/kvm: Fix ABI for use of 64-bit registers.

2013-05-22 Thread David Daney
From: David Daney david.da...@cavium.com All registers are 64-bits wide, 32-bit guests use the least significant portion of the register storage fields. Signed-off-by: David Daney david.da...@cavium.com --- arch/mips/include/asm/kvm.h | 16 +++- 1 file changed, 11 insertions(+), 5

[PATCH v5 1/6] mips/kvm: Fix ABI for use of FPU.

2013-05-22 Thread David Daney
From: David Daney david.da...@cavium.com Define a non-empty struct kvm_fpu. Signed-off-by: David Daney david.da...@cavium.com --- arch/mips/include/asm/kvm.h | 29 + 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/arch/mips/include/asm/kvm.h

[PATCH v5 6/6] mips/kvm: Use ENOIOCTLCMD to indicate unimplemented ioctls.

2013-05-22 Thread David Daney
From: David Daney david.da...@cavium.com The Linux Way is to return -ENOIOCTLCMD to the vfs when an unimplemented ioctl is requested. Do this in kvm_mips instead of a random mixture of -ENOTSUPP and -EINVAL. Signed-off-by: David Daney david.da...@cavium.com --- arch/mips/kvm/kvm_mips.c | 18

[PATCH v5 4/6] mips/kvm: Use ARRAY_SIZE() instead of hardcoded constants in kvm_arch_vcpu_ioctl_{s,g}et_regs

2013-05-22 Thread David Daney
From: David Daney david.da...@cavium.com Also we cannot set special zero register, so force it to zero. Signed-off-by: David Daney david.da...@cavium.com --- arch/mips/kvm/kvm_mips.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/mips/kvm/kvm_mips.c

[PATCH v5 5/6] mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_ONE_REG

2013-05-22 Thread David Daney
From: David Daney david.da...@cavium.com Because not all 256 CP0 registers are ever implemented, we need a different method of manipulating them. Use the KVM_SET_ONE_REG/KVM_GET_ONE_REG mechanism. Now unused code and definitions are removed. Signed-off-by: David Daney david.da...@cavium.com

[PATCH v5 3/6] mips/kvm: Fix name of gpr field in struct kvm_regs.

2013-05-22 Thread David Daney
From: David Daney david.da...@cavium.com Signed-off-by: David Daney david.da...@cavium.com --- arch/mips/include/asm/kvm.h | 3 ++- arch/mips/kvm/kvm_mips.c| 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/arch/mips/include/asm/kvm.h b/arch/mips/include/asm/kvm.h index

Re: [PATCH v5 0/6] mips/kvm: Fix ABI for compatibility with 64-bit guests.

2013-05-22 Thread Sanjay Lal
On May 22, 2013, at 11:43 AM, David Daney wrote: From: David Daney david.da...@cavium.com The initial patch set implementing MIPS KVM does not handle 64-bit guests or use of the FPU. This patch set corrects these ABI issues, and does some very minor clean up. Changes from v4: No code

[PATCH v7 04/11] KVM: MMU: zap pages in batch

2013-05-22 Thread Xiao Guangrong
Zap at lease 10 pages before releasing mmu-lock to reduce the overload caused by requiring lock After the patch, kvm_zap_obsolete_pages can forward progress anyway, so update the comments [ It improves kernel building 0.6% ~ 1% ] Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com

[PATCH v7 05/11] KVM: x86: use the fast way to invalidate all pages

2013-05-22 Thread Xiao Guangrong
Replace kvm_mmu_zap_all by kvm_mmu_invalidate_zap_all_pages Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c | 15 --- arch/x86/kvm/x86.c |4 ++-- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/arch/x86/kvm/mmu.c

[PATCH v7 07/11] KVM: MMU: add tracepoint for kvm_mmu_invalidate_all_pages

2013-05-22 Thread Xiao Guangrong
It is good for debug and development Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c |1 + arch/x86/kvm/mmutrace.h | 20 2 files changed, 21 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c

[PATCH v7 11/11] KVM: MMU: reduce KVM_REQ_MMU_RELOAD when root page is zapped

2013-05-22 Thread Xiao Guangrong
From: Gleb Natapov g...@redhat.com Quote Gleb's mail: | why don't we check for sp-role.invalid in | kvm_mmu_prepare_zap_page before calling kvm_reload_remote_mmus()? and | Actually we can add check for is_obsolete_sp() there too since | kvm_mmu_invalidate_all_pages() already calls

[PATCH v7 10/11] KVM: MMU: collapse TLB flushes when zap all pages

2013-05-22 Thread Xiao Guangrong
kvm_zap_obsolete_pages uses lock-break technique to zap pages, it will flush tlb every time when it does lock-break We can reload mmu on all vcpus after updating the generation number so that the obsolete pages are not used on any vcpus, after that we do not need to flush tlb when obsolete pages

[PATCH v7 08/11] KVM: MMU: do not reuse the obsolete page

2013-05-22 Thread Xiao Guangrong
The obsolete page will be zapped soon, do not resue it to reduce future page fault Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmu.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c index

[PATCH v7 00/11] KVM: MMU: fast zap all shadow pages

2013-05-22 Thread Xiao Guangrong
Changlog: V7: 1): separate some optimization into two patches which do not reuse the obsolete pages and collapse tlb flushes, suggested by Marcelo. 2): make the patch based on Gleb's diff change which reduce KVM_REQ_MMU_RELOAD when root page is being zapped. 3): remove calling

[PATCH v7 01/11] KVM: x86: drop calling kvm_mmu_zap_all in emulator_fix_hypercall

2013-05-22 Thread Xiao Guangrong
Quote Gleb's mail: | Back then kvm-lock protected memslot access so code like: | | mutex_lock(vcpu-kvm-lock); | kvm_mmu_zap_all(vcpu-kvm); | mutex_unlock(vcpu-kvm-lock); | | which is what 7aa81cc0 does was enough to guaranty that no vcpu will | run while code is patched. This is no longer the

[PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-22 Thread Xiao Guangrong
It is only used to zap the obsolete page. Since the obsolete page will not be used, we need not spend time to find its unsync children out. Also, we delete the page from shadow page cache so that the page is completely isolated after call this function. The later patch will use it to collapse tlb

[PATCH v7 06/11] KVM: MMU: show mmu_valid_gen in shadow page related tracepoints

2013-05-22 Thread Xiao Guangrong
Show sp-mmu_valid_gen Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com --- arch/x86/kvm/mmutrace.h | 22 -- 1 files changed, 12 insertions(+), 10 deletions(-) diff --git a/arch/x86/kvm/mmutrace.h b/arch/x86/kvm/mmutrace.h index b8f6172..697f466 100644 ---

[PATCH v7 03/11] KVM: MMU: fast invalidate all pages

2013-05-22 Thread Xiao Guangrong
The current kvm_mmu_zap_all is really slow - it is holding mmu-lock to walk and zap all shadow pages one by one, also it need to zap all guest page's rmap and all shadow page's parent spte list. Particularly, things become worse if guest uses more memory or vcpus. It is not good for scalability

[PATCH v7 02/11] KVM: MMU: drop unnecessary kvm_reload_remote_mmus

2013-05-22 Thread Xiao Guangrong
It is the responsibility of kvm_mmu_zap_all that keeps the consistent of mmu and tlbs. And it is also unnecessary after zap all mmio sptes since no mmio spte exists on root shadow page and it can not be cached into tlb Signed-off-by: Xiao Guangrong xiaoguangr...@linux.vnet.ibm.com ---

Re: [PATCH v2 10/10] kernel: might_fault does not imply might_sleep

2013-05-22 Thread Michael S. Tsirkin
On Thu, May 16, 2013 at 08:40:41PM +0200, Peter Zijlstra wrote: On Thu, May 16, 2013 at 02:16:10PM +0300, Michael S. Tsirkin wrote: There are several ways to make sure might_fault calling function does not sleep. One is to use it on kernel or otherwise locked memory - apparently

Re: [PATCH v2 10/10] kernel: might_fault does not imply might_sleep

2013-05-22 Thread Michael S. Tsirkin
On Tue, May 21, 2013 at 01:57:34PM +0200, Peter Zijlstra wrote: On Sun, May 19, 2013 at 12:35:26PM +0300, Michael S. Tsirkin wrote: --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -198,7 +198,6 @@ void might_fault(void); #else static inline void

[PATCH 3/5] x86: Annotate _ASM_EXTABLE users to distinguish uaccess from everything else

2013-05-22 Thread Andy Lutomirski
The idea is that the kernel can be much more careful fixing up uaccess exceptions -- page faults on user addresses are the only legitimate reason for a uaccess instruction to fault. Signed-off-by: Andy Lutomirski l...@amacapital.net --- I'm not 100% sure what's happening in the KVM code. Can

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-22 Thread Scott Wood
On 05/20/2013 10:06:46 PM, Alexey Kardashevskiy wrote: diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 8465c2a..da6bf61 100644 --- a/arch/powerpc/kvm/powerpc.c @@ -396,6 +396,7 @@ int kvm_dev_ioctl_check_extension(long ext) +++ b/arch/powerpc/kvm/powerpc.c

Re: [RFC PATCH v2 2/2] add support for Hyper-V invariant TSC

2013-05-22 Thread Marcelo Tosatti
On Wed, May 22, 2013 at 03:22:55AM -0400, Vadim Rozenfeld wrote: - Original Message - From: Marcelo Tosatti mtosa...@redhat.com To: Vadim Rozenfeld vroze...@redhat.com Cc: kvm@vger.kernel.org, g...@redhat.com, p...@dlh.net Sent: Wednesday, May 22, 2013 10:50:46 AM Subject: Re:

Re: [RFC PATCH v2 1/2] add support for Hyper-V reference time counter

2013-05-22 Thread Paolo Bonzini
Il 22/05/2013 09:32, Vadim Rozenfeld ha scritto: @@ -1827,6 +1829,29 @@ static int set_msr_hyperv_pw(struct kvm_vcpu *vcpu, u32 msr, u64 data) if (__copy_to_user((void __user *)addr, instructions, 4)) return 1; kvm-arch.hv_hypercall = data; +

[PATCH] qemu-kvm: fix unmatched RAM alloction/free

2013-05-22 Thread Xudong Hao
mmap is used in qemu_vmalloc function instead of qemu_memalign(commit 7dda5dc8), so it should change qemu_vfree to munmap to fix a unmatched issue. This issue appears when a PCI device is being assigned to KVM guest, failure to read PCI rom file will bring RAM free, then the incorrect qemu_vfree

Re: provide vhost thread per virtqueue for forwarding scenario

2013-05-22 Thread Rusty Russell
Jason Wang jasow...@redhat.com writes: On 05/22/2013 05:59 PM, Zang Hongyong wrote: On 2013/5/20 15:43, Michael S. Tsirkin wrote: On Mon, May 20, 2013 at 02:11:19AM +, Qinchuanyu wrote: Yes, I don't think we want to create threads even more aggressively in all cases. I'm worried about

Re: [PATCH v7 09/11] KVM: MMU: introduce kvm_mmu_prepare_zap_obsolete_page

2013-05-22 Thread Gleb Natapov
On Thu, May 23, 2013 at 03:55:58AM +0800, Xiao Guangrong wrote: It is only used to zap the obsolete page. Since the obsolete page will not be used, we need not spend time to find its unsync children out. Also, we delete the page from shadow page cache so that the page is completely isolated

Re: [PATCH 3/4] KVM: PPC: Add support for IOMMU in-kernel handling

2013-05-22 Thread Scott Wood
On 05/20/2013 10:06:46 PM, Alexey Kardashevskiy wrote: diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index 8465c2a..da6bf61 100644 --- a/arch/powerpc/kvm/powerpc.c @@ -396,6 +396,7 @@ int kvm_dev_ioctl_check_extension(long ext) +++ b/arch/powerpc/kvm/powerpc.c