Re: [PATCH RFC] kvm: optimize out smp_mb using srcu_read_unlock

2013-10-31 Thread Gleb Natapov
On Wed, Oct 30, 2013 at 09:56:29PM -0700, Paul E. McKenney wrote: On Thu, Oct 31, 2013 at 01:26:05AM +0200, Michael S. Tsirkin wrote: Paul, could you review this patch please? Documentation/memory-barriers.txt says that unlock has a weaker uni-directional barrier, but in practice

Re: 8bf00a529967dafbbb210b377c38a15834d1e979 - performance regression?

2013-10-31 Thread Gleb Natapov
On Thu, Oct 31, 2013 at 02:21:46AM +0200, Michael S. Tsirkin wrote: commit 8bf00a529967dafbbb210b377c38a15834d1e979: KVM: VMX: add support for switching of PERF_GLOBAL_CTRL was as far as I can tell supposed to bring about performance improvement on hardware that supports it? No, it (and

Re: Calling to kvm_mmu_load

2013-10-31 Thread Arthur Chunqi Li
Hi Paolo, On Tue, Oct 29, 2013 at 8:55 PM, Paolo Bonzini pbonz...@redhat.com wrote: Il 29/10/2013 06:39, Arthur Chunqi Li ha scritto: What is the dirty page tracking code path? I find a obsoleted flag dirty_page_log_all in the very previous codes, but I cannot get the most recent version of

Re: RFC: paravirtualizing perf_clock

2013-10-31 Thread Masami Hiramatsu
(2013/10/30 23:03), David Ahern wrote: On 10/29/13 11:59 PM, Masami Hiramatsu wrote: (2013/10/29 11:58), David Ahern wrote: To back out a bit, my end goal is to be able to create and merge perf-events from any context on a KVM-based host -- guest userspace, guest kernel space, host userspace

Re: [PATCH 0/2] KVM_SET_XCRS fixes

2013-10-31 Thread Gleb Natapov
On Thu, Oct 17, 2013 at 04:50:45PM +0200, Paolo Bonzini wrote: The first patch fixes bugs 63121 and 63131 (yeah, all kernel bugs end with 1). The second patch fixes a typo (the same typo exists in QEMU). Paolo Bonzini (2): KVM: x86: fix KVM_SET_XCRS for CPUs that do not support XSAVE

Re: Calling to kvm_mmu_load

2013-10-31 Thread Paolo Bonzini
Il 31/10/2013 09:05, Arthur Chunqi Li ha scritto: Basically everything that accesses the dirty_bitmap field of struct kvm_memory_slot is involved. It all starts when the KVM_SET_USER_MEMORY_REGION ioctl is called with the KVM_MEM_LOG_DIRTY_PAGES flag set. I find the mechanism here is

[PATCH] KVM: x86: emulate SAHF instruction

2013-10-31 Thread Paolo Bonzini
Yet another instruction that we fail to emulate, this time found in Windows 2008R2 32-bit. Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- Testcase on its way. BTW, lahf/sahf is another candidate for #UD emulation. arch/x86/kvm/emulate.c | 14

[PATCH] [kvm-unit-tests] realmode: test SAHF instruction

2013-10-31 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- x86/realmode.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/x86/realmode.c b/x86/realmode.c index 3546771..b9cb634 100644 --- a/x86/realmode.c +++ b/x86/realmode.c @@ -1409,6 +1409,15 @@ static void test_sgdt_sidt(void)

Re: EPT page fault procedure

2013-10-31 Thread Paolo Bonzini
Il 31/10/2013 10:07, Arthur Chunqi Li ha scritto: Sorry to disturb you with so many trivial questions in KVM EPT memory management and thanks for your patience. No problem, please remain onlist though. Adding back kvm@vger.kernel.org. I got confused in the EPT page fault processing

Re: [PATCH 2/3] Documentation/kvm: patches should be against linux.git

2013-10-31 Thread Paolo Bonzini
Il 31/10/2013 11:46, Ramkumar Ramachandra ha scritto: The document hasn't been updated since cf3e3d3 (KVM: Document KVM specific review items, 2010-06-24); kvm does not have a separate repository anymore. Maintainer have their repository at git://git.kernel.org/pub/scm/virt/kvm/kvm.git. The

[PATCH v2] MAINTAINERS: add tree for kvm.git

2013-10-31 Thread Ramkumar Ramachandra
Cc: Gleb Natapov g...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: KVM List kvm@vger.kernel.org Signed-off-by: Ramkumar Ramachandra artag...@gmail.com --- This is a replacement for [PATCH 2/3] Documentation/kvm: patches should be against linux.git Thanks to Paolo for pointing to the

[PATCH] MAINTAINERS: Add git tree for KVM

2013-10-31 Thread Paolo Bonzini
Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index fed84d861e7f..366f90cc6fdb 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -4815,6 +4815,7 @@ M:Gleb Natapov g...@redhat.com M: Paolo

Re: [PATCH v2] MAINTAINERS: add tree for kvm.git

2013-10-31 Thread Paolo Bonzini
Il 31/10/2013 11:59, Ramkumar Ramachandra ha scritto: Cc: Gleb Natapov g...@redhat.com Cc: Paolo Bonzini pbonz...@redhat.com Cc: KVM List kvm@vger.kernel.org Signed-off-by: Ramkumar Ramachandra artag...@gmail.com --- This is a replacement for [PATCH 2/3] Documentation/kvm: patches should

Re: [PATCH RFC] kvm: optimize out smp_mb using srcu_read_unlock

2013-10-31 Thread Paolo Bonzini
Il 31/10/2013 07:47, Gleb Natapov ha scritto: This looks dubious to me. All other smp_mb__after_* variants are there because some atomic operations have different memory barrier semantics on different arches, It doesn't have to be arches; unlock APIs typically have release semantics only, but

Re: [PATCH RFC] kvm: optimize out smp_mb using srcu_read_unlock

2013-10-31 Thread Paolo Bonzini
Il 30/10/2013 20:09, Michael S. Tsirkin ha scritto: I noticed that srcu_read_lock/unlock both have a memory barrier, so just by moving srcu_read_unlock earlier we can get rid of one call to smp_mb(). Unsurprisingly, the gain is small but measureable using the unit test microbenchmark:

Re: [PATCH RFC] kvm: optimize out smp_mb using srcu_read_unlock

2013-10-31 Thread Michael S. Tsirkin
On Thu, Oct 31, 2013 at 12:14:15PM +0100, Paolo Bonzini wrote: Il 30/10/2013 20:09, Michael S. Tsirkin ha scritto: I noticed that srcu_read_lock/unlock both have a memory barrier, so just by moving srcu_read_unlock earlier we can get rid of one call to smp_mb(). Unsurprisingly, the

Re: [PATCH RFC] kvm: optimize out smp_mb using srcu_read_unlock

2013-10-31 Thread Gleb Natapov
On Thu, Oct 31, 2013 at 12:11:21PM +0100, Paolo Bonzini wrote: Il 31/10/2013 07:47, Gleb Natapov ha scritto: This looks dubious to me. All other smp_mb__after_* variants are there because some atomic operations have different memory barrier semantics on different arches, It doesn't have

Re: [PATCH] kvm_host: typo fix

2013-10-31 Thread Paolo Bonzini
Il 30/10/2013 20:43, Michael S. Tsirkin ha scritto: fix up typo in comment. Signed-off-by: Michael S. Tsirkin m...@redhat.com --- include/linux/kvm_host.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index

Re: [PATCH RFC] kvm: optimize out smp_mb using srcu_read_unlock

2013-10-31 Thread Michael S. Tsirkin
On Wed, Oct 30, 2013 at 09:56:29PM -0700, Paul E. McKenney wrote: On Thu, Oct 31, 2013 at 01:26:05AM +0200, Michael S. Tsirkin wrote: Paul, could you review this patch please? Documentation/memory-barriers.txt says that unlock has a weaker uni-directional barrier, but in practice

Re: [PATCH] KVM: x86: emulate SAHF instruction

2013-10-31 Thread Gleb Natapov
On Thu, Oct 31, 2013 at 11:29:42AM +0100, Paolo Bonzini wrote: Yet another instruction that we fail to emulate, this time found in Windows 2008R2 32-bit. Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com --- Testcase on its way. BTW, lahf/sahf is another

Re: [PATCH] KVM: x86: emulate SAHF instruction

2013-10-31 Thread Paolo Bonzini
Il 31/10/2013 15:21, Gleb Natapov ha scritto: On Thu, Oct 31, 2013 at 11:29:42AM +0100, Paolo Bonzini wrote: Yet another instruction that we fail to emulate, this time found in Windows 2008R2 32-bit. Cc: sta...@vger.kernel.org Signed-off-by: Paolo Bonzini pbonz...@redhat.com ---

Re: [PATCH] KVM: x86: emulate SAHF instruction

2013-10-31 Thread Gleb Natapov
On Thu, Oct 31, 2013 at 03:27:48PM +0100, Paolo Bonzini wrote: Il 31/10/2013 15:21, Gleb Natapov ha scritto: On Thu, Oct 31, 2013 at 11:29:42AM +0100, Paolo Bonzini wrote: Yet another instruction that we fail to emulate, this time found in Windows 2008R2 32-bit. Cc:

Re: [PATCH] KVM: x86: emulate SAHF instruction

2013-10-31 Thread Paolo Bonzini
Il 31/10/2013 15:34, Gleb Natapov ha scritto: I haven't checked AMD doc, but if it is documented that lahf/sahf #UDs at 64 bit we should emulate it correctly. It says The LAHF instruction can only be executed in 64-bit mode if supported by the processor implementation. Check the status of ECX

Re: [PATCH] KVM: x86: emulate SAHF instruction

2013-10-31 Thread Borislav Petkov
On Thu, Oct 31, 2013 at 03:49:04PM +0100, Paolo Bonzini wrote: Il 31/10/2013 15:34, Gleb Natapov ha scritto: I haven't checked AMD doc, but if it is documented that lahf/sahf #UDs at 64 bit we should emulate it correctly. It says The LAHF instruction can only be executed in 64-bit mode if

Re: [PATCH] KVM: x86: emulate SAHF instruction

2013-10-31 Thread Gleb Natapov
On Thu, Oct 31, 2013 at 03:49:04PM +0100, Paolo Bonzini wrote: Il 31/10/2013 15:34, Gleb Natapov ha scritto: I haven't checked AMD doc, but if it is documented that lahf/sahf #UDs at 64 bit we should emulate it correctly. It says The LAHF instruction can only be executed in 64-bit mode if

Re: RFC: paravirtualizing perf_clock

2013-10-31 Thread David Ahern
On 10/31/13, 2:09 AM, Masami Hiramatsu wrote: (2013/10/30 23:03), David Ahern wrote: On 10/29/13 11:59 PM, Masami Hiramatsu wrote: (2013/10/29 11:58), David Ahern wrote: To back out a bit, my end goal is to be able to create and merge perf-events from any context on a KVM-based host -- guest

[PULL 04/51] KVM: PPC: Book3S: Add GET/SET_ONE_REG interface for VRSAVE

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org The VRSAVE register value for a vcpu is accessible through the GET/SET_SREGS interface for Book E processors, but not for Book 3S processors. In order to make this accessible for Book 3S processors, this adds a new register identifier for GET/SET_ONE_REG,

[PULL 00/51] ppc patch queue 2013-10-31

2013-10-31 Thread Alexander Graf
Hi Paolo / Gleb, This is my current patch queue for ppc. Please pull. Highlights of this request are: - Book3s HV and PR can be built into the same kernel - e500 target debug support - Book3s POWER8 preparation - Lots of book3s PR fixes I left out the FPU rework from Paul in this

[PULL 05/51] KVM: PPC: Book3S HV: Implement H_CONFER

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org The H_CONFER hypercall is used when a guest vcpu is spinning on a lock held by another vcpu which has been preempted, and the spinning vcpu wishes to give its timeslice to the lock holder. We implement this in the straightforward way using

[PULL 47/51] kvm: powerpc: booke: Move booke related tracepoints to separate header

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/booke.c | 4 +- arch/powerpc/kvm/e500_mmu.c | 2 +- arch/powerpc/kvm/e500_mmu_host.c | 3 +-

[PULL 44/51] kvm: powerpc: book3s: Cleanup interrupt handling code

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com With this patch if HV is included, interrupts come in to the HV version of the kvmppc_interrupt code, which then jumps to the PR handler, renamed to kvmppc_interrupt_pr, if the guest is a PR guest. This helps in enabling both HV and PR, which

[PULL 42/51] kvm: powerpc: book3s: Add a new config variable CONFIG_KVM_BOOK3S_HV_POSSIBLE

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This help ups to select the relevant code in the kernel code when we later move HV and PR bits as seperate modules. The patch also makes the config options for PR KVM selectable Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com

[PULL 48/51] kvm: powerpc: book3s: Support building HV and PR KVM as module

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com [agraf: squash in compile fix] Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/Kconfig | 6 +++--- arch/powerpc/kvm/Makefile | 11 ---

[PULL 08/51] KVM: PPC: Book3S HV: Avoid unbalanced increments of VPA yield count

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org The yield count in the VPA is supposed to be incremented every time we enter the guest, and every time we exit the guest, so that its value is even when the vcpu is running in the guest and odd when it isn't. However, it's currently possible that we

[PULL 51/51] kvm: powerpc: book3s: drop is_hv_enabled

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com drop is_hv_enabled, because that should not be a callback property Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_ppc.h | 6 +-

[PULL 46/51] kvm: powerpc: book3s: pr: move PR related tracepoints to a separate header

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This patch moves PR related tracepoints to a separate header. This enables in converting PR to a kernel module which will be done in later patches Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Alexander Graf

[PULL 50/51] kvm: powerpc: book3s: Allow the HV and PR selection per virtual machine

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This moves the kvmppc_ops callbacks to be a per VM entity. This enables us to select HV and PR mode when creating a VM. We also allow both kvm-hv and kvm-pr kernel module to be loaded. To achieve this we move /dev/kvm ownership to kvm.ko

[PULL 41/51] kvm: powerpc: book3s: pr: Rename KVM_BOOK3S_PR to KVM_BOOK3S_PR_POSSIBLE

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com With later patches supporting PR kvm as a kernel module, the changes that has to be built into the main kernel binary to enable PR KVM module is now selected via KVM_BOOK3S_PR_POSSIBLE Signed-off-by: Aneesh Kumar K.V

[PULL 36/51] KVM: PPC: E500: exit to user space on ehpriv 1 instruction

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com ehpriv 1 instruction is used for setting software breakpoints by user space. This patch adds support to exit to user space with run-debug have relevant information. As this is the first point we are using run-debug, also defined the run-debug structure.

[PULL 29/51] powerpc: book3e: _PAGE_LENDIAN must be _PAGE_ENDIAN

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com For booke3e _PAGE_ENDIAN is not defined. Infact what is defined is _PAGE_LENDIAN which is wrong and that should be _PAGE_ENDIAN. There are no compilation errors as arch/powerpc/include/asm/pte-common.h defines _PAGE_ENDIAN to 0 as it is not defined

[PULL 45/51] kvm: powerpc: book3s: Add is_hv_enabled to kvmppc_ops

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This help us to identify whether we are running with hypervisor mode KVM enabled. The change is needed so that we can have both HV and PR kvm enabled in the same kernel. If both HV and PR KVM are included, interrupts come in to the HV

[PULL 49/51] kvm: Add struct kvm arg to memslot APIs

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We will use that in the later patch to find the kvm ops handler Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/arm/kvm/arm.c | 5 +++--

[PULL 34/51] powerpc: move debug registers in a structure

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com This way we can use same data type struct with KVM and also help in using other debug related function. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/processor.h | 38

[PULL 31/51] kvm: powerpc: allow guest control G attribute in mas2

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com G bit in MAS2 indicates whether the page is Guarded. There is no reason to stop guest setting G, so allow him. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/e500.h | 2 +- 1

[PULL 18/51] KVM: PPC: Book3S PR: Handle PP0 page-protection bit in guest HPTEs

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org 64-bit POWER processors have a three-bit field for page protection in the hashed page table entry (HPTE). Currently we only interpret the two bits that were present in older versions of the architecture. The only defined combination that has the new bit set

[PULL 12/51] KVM: PPC: Book3S HV: Support POWER6 compatibility mode on POWER7

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This enables us to use the Processor Compatibility Register (PCR) on POWER7 to put the processor into architecture 2.05 compatibility mode when running a guest. In this mode the new instructions and registers that were introduced on POWER7 are disabled in

[PULL 19/51] KVM: PPC: Book3S PR: Correct errors in H_ENTER implementation

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org The implementation of H_ENTER in PR KVM has some errors: * With H_EXACT not set, if the HPTEG is full, we return H_PTEG_FULL as the return value of kvmppc_h_pr_enter, but the caller is expecting one of the EMULATE_* values. The H_PTEG_FULL needs to go

[PULL 27/51] kvm: powerpc: book3s hv: Fix vcore leak

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org add kvmppc_free_vcores() to free the kvmppc_vcore structures that we allocate for a guest, which are currently being leaked. Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by:

[PULL 24/51] KVM: PPC: Book3S PR: Use mmu_notifier_retry() in kvmppc_mmu_map_page()

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org When the MM code is invalidating a range of pages, it calls the KVM kvm_mmu_notifier_invalidate_range_start() notifier function, which calls kvm_unmap_hva_range(), which arranges to flush all the existing host HPTEs for guest pages. However, the Linux PTEs

[PULL 20/51] KVM: PPC: Book3S PR: Make HPT accesses and updates SMP-safe

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This adds a per-VM mutex to provide mutual exclusion between vcpus for accesses to and updates of the guest hashed page table (HPT). This also makes the code use single-byte writes to the HPT entry when updating of the reference (R) and change (C) bits. The

[PULL 23/51] KVM: PPC: Book3S PR: Better handling of host-side read-only pages

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Currently we request write access to all pages that get mapped into the guest, even if the guest is only loading from the page. This reduces the effectiveness of KSM because it means that we unshare every page we access. Also, we always set the changed (C)

[PULL 10/51] KVM: PPC: Book3S HV: Store LPCR value for each virtual core

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This adds the ability to have a separate LPCR (Logical Partitioning Control Register) value relating to a guest for each virtual core, rather than only having a single value for the whole VM. This corresponds to what real POWER hardware does, where there is

[PULL 37/51] KVM: PPC: E500: Using struct debug_reg

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com For KVM also use the struct debug_reg defined in asm/processor.h Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_host.h | 13 + arch/powerpc/kvm/booke.c

[PULL 38/51] KVM: PPC: E500: Add userspace debug stub support

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com This patch adds the debug stub support on booke/bookehv. Now QEMU debug stub can use hw breakpoint, watchpoint and software breakpoint to debug guest. This is how we save/restore debug register context when switching between guest, userspace and kernel

[PULL 28/51] KVM: PPC: Book3S HV: Better handling of exceptions that happen in real mode

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org When an interrupt or exception happens in the guest that comes to the host, the CPU goes to hypervisor real mode (MMU off) to handle the exception but doesn't change the MMU context. After saving a few registers, we then clear the in guest flag. If, for any

[PULL 14/51] KVM: PPC: Book3S PR: Fix compilation without CONFIG_ALTIVEC

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Commit 9d1ffdd8f3 (KVM: PPC: Book3S PR: Don't corrupt guest state when kernel uses VMX) added a call to kvmppc_load_up_altivec() that isn't guarded by CONFIG_ALTIVEC, causing a link failure when building a kernel without CONFIG_ALTIVEC set. This adds an

[PULL 39/51] kvm: powerpc: book3s: remove kvmppc_handler_highmem label

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This label is not used now. Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/book3s_hv_interrupts.S | 3 ---

[PULL 33/51] powerpc: remove unnecessary line continuations

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kernel/process.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/process.c

[PULL 25/51] KVM: PPC: Book3S PR: Mark pages accessed, and dirty if being written

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org The mark_page_dirty() function, despite what its name might suggest, doesn't actually mark the page as dirty as far as the MM subsystem is concerned. It merely sets a bit in KVM's map of dirty pages, if userspace has requested dirty tracking for the relevant

[PULL 26/51] KVM: PPC: Book3S PR: Reduce number of shadow PTEs invalidated by MMU notifiers

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Currently, whenever any of the MMU notifier callbacks get called, we invalidate all the shadow PTEs. This is inefficient because it means that we typically then get a lot of DSIs and ISIs in the guest to fault the shadow PTEs back in. We do this even if the

[PULL 21/51] KVM: PPC: Book3S PR: Allocate kvm_vcpu structs from kvm_vcpu_cache

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This makes PR KVM allocate its kvm_vcpu structs from the kvm_vcpu_cache rather than having them embedded in the kvmppc_vcpu_book3s struct, which is allocated with vzalloc. The reason is to reduce the differences between PR and HV KVM in order to make is

[PULL 22/51] KVM: PPC: Book3S: Move skip-interrupt handlers to common code

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Both PR and HV KVM have separate, identical copies of the kvmppc_skip_interrupt and kvmppc_skip_Hinterrupt handlers that are used for the situation where an interrupt happens when loading the instruction that caused an exit from the guest. To eliminate this

[PULL 40/51] kvm: powerpc: book3s: move book3s_64_vio_hv.c into the main kernel binary

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Since the code in book3s_64_vio_hv.c is called from real mode with HV KVM, and therefore has to be built into the main kernel binary, this makes it always built-in rather than part of the KVM module. It gets called from the KVM module by PR KVM, so this adds

[PULL 30/51] kvm: powerpc: allow guest control E attribute in mas2

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com E bit in MAS2 bit indicates whether the page is accessed in Little-Endian or Big-Endian byte order. There is no reason to stop guest setting E, so allow him. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Signed-off-by: Alexander Graf

[PULL 02/51] KVM: PPC: Book3S HV: Save/restore SIAR and SDAR along with other PMU registers

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Currently we are not saving and restoring the SIAR and SDAR registers in the PMU (performance monitor unit) on guest entry and exit. The result is that performance monitoring tools in the guest could get false information about where a program was executing

[PULL 11/51] KVM: PPC: Book3S HV: Add support for guest Program Priority Register

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org POWER7 and later IBM server processors have a register called the Program Priority Register (PPR), which controls the priority of each hardware CPU SMT thread, and affects how fast it runs compared to other SMT threads. This priority can be controlled by

[PULL 13/51] KVM: PPC: Book3S HV: Don't crash host on unknown guest interrupt

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org If we come out of a guest with an interrupt that we don't know about, instead of crashing the host with a BUG(), we now return to userspace with the exit reason set to KVM_EXIT_UNKNOWN and the trap vector in the hw.hardware_exit_reason field of the kvm_run

[PULL 06/51] KVM: PPC: Book3S HV: Restructure kvmppc_hv_entry to be a subroutine

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org We have two paths into and out of the low-level guest entry and exit code: from a vcpu task via kvmppc_hv_entry_trampoline, and from the system reset vector for an offline secondary thread on POWER7 via kvm_start_guest. Currently both just branch to

[PULL 03/51] KVM: PPC: Book3S HV: Implement timebase offset for guests

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This allows guests to have a different timebase origin from the host. This is needed for migration, where a guest can migrate from one host to another and the two hosts might have a different timebase origin. However, the timebase seen by the guest must not

[PULL 15/51] KVM: PPC: Book3S PR: Keep volatile reg values in vcpu rather than shadow_vcpu

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Currently PR-style KVM keeps the volatile guest register values (R0 - R13, CR, LR, CTR, XER, PC) in a shadow_vcpu struct rather than the main kvm_vcpu struct. For 64-bit, the shadow_vcpu exists in two places, a kmalloc'd struct and in the PACA, and it gets

[PULL 09/51] KVM: PPC: BookE: Add GET/SET_ONE_REG interface for VRSAVE

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This makes the VRSAVE register value for a vcpu accessible through the GET/SET_ONE_REG interface on Book E systems (in addition to the existing GET/SET_SREGS interface), for consistency with Book 3S. Signed-off-by: Paul Mackerras pau...@samba.org

[PULL 07/51] KVM: PPC: Book3S HV: Pull out interrupt-reading code into a subroutine

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This moves the code in book3s_hv_rmhandlers.S that reads any pending interrupt from the XICS interrupt controller, and works out whether it is an IPI for the guest, an IPI for the host, or a device interrupt, into a new function called kvmppc_read_intr.

[PULL 16/51] KVM: PPC: Book3S PR: Allow guest to use 64k pages

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org This adds the code to interpret 64k HPTEs in the guest hashed page table (HPT), 64k SLB entries, and to tell the guest about 64k pages in kvm_vm_ioctl_get_smmu_info(). Guest 64k pages are still shadowed by 4k pages. This also adds another hash table to the

[PULL 01/51] KVM: PPC: Book3S HV: Reserve POWER8 space in get/set_one_reg

2013-10-31 Thread Alexander Graf
From: Michael Neuling mi...@neuling.org This reserves space in get/set_one_reg ioctl for the extra guest state needed for POWER8. It doesn't implement these at all, it just reserves them so that the ABI is defined now. A few things to note here: - This add *a lot* state for transactional

[PULL 17/51] KVM: PPC: Book3S PR: Use 64k host pages where possible

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Currently, PR KVM uses 4k pages for the host-side mappings of guest memory, regardless of the host page size. When the host page size is 64kB, we might as well use 64k host page mappings for guest mappings of 64kB and larger pages and for guest real-mode

[PULL 32/51] kvm: powerpc: e500: mark page accessed when mapping a guest page

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com Mark the guest page as accessed so that there is likely less chances of this page getting swap-out. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Acked-by: Scott Wood scottw...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de ---

[PULL 35/51] powerpc: export debug registers save function for KVM

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com KVM need this function when switching from vcpu to user-space thread. My subsequent patch will use this function. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Acked-by: Michael Neuling mi...@neuling.org Signed-off-by: Alexander Graf

Greetings:

2013-10-31 Thread Cham Tao Soon
Hello: Can you assist me to move funds from Singapore? Please reply. Cham Tao Soon -- 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 http://vger.kernel.org/majordomo-info.html

Help regarding virsh domifstat

2013-10-31 Thread Rohit Bhat
Hi, I need a small help. I am working on a project where i have to monitor network activity of a VM running on KVM. I am interested in how much data is going into the VM and how much data is coming out of the VM. I checked on the net and found out virsh domifstat is the way to go about it. 1.

[PATCH 0/2] kvm tools: fix vhost-net broken since fa7226f88012713a73d0cba4955444ea109e9458

2013-10-31 Thread Ying-Shiuan Pan
These patch series fix 2 vhost-net problems. There were 2 problems after commit fa7226f88012713a73d0cba4955444ea109e9458. (1) vhost-net requires tap_fd for VHOST_SET_BACKEND, but opening tap device was postponed to VIRTIO_CONFIG_S_DRIVER_OK. The wrong order of initialization caused vhost-net used

[PATCH 1/2] kvm tools: virtio-net has to open tap device before vhost-net init.

2013-10-31 Thread Ying-Shiuan Pan
Enabling vhost-net encounted an error: Fatal: VHOST_NET_SET_BACKEND failed 88 The reason is that vhost-net requires tap_fd for VHOST_NET_SET_BACKEND, however tap_fd is opened after VIRTIO_CONFIG_S_DRIVER_OK. Because the initialization needs to know the guest features, I suppose the

[PATCH 2/2] kvm tools: vhost-net: setup mergeable rx buffers feature

2013-10-31 Thread Ying-Shiuan Pan
After features negotiation, kvmtool should tell vhost-net that he's using mergeable rx buffers. Signed-off-by: Ying-Shiuan Pan ys...@itri.org.tw --- tools/kvm/virtio/net.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tools/kvm/virtio/net.c

[PULL 00/51] ppc patch queue 2013-10-31

2013-10-31 Thread Alexander Graf
Hi Paolo / Gleb, This is my current patch queue for ppc. Please pull. Highlights of this request are: - Book3s HV and PR can be built into the same kernel - e500 target debug support - Book3s POWER8 preparation - Lots of book3s PR fixes I left out the FPU rework from Paul in this

[PULL 02/51] KVM: PPC: Book3S HV: Save/restore SIAR and SDAR along with other PMU registers

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Currently we are not saving and restoring the SIAR and SDAR registers in the PMU (performance monitor unit) on guest entry and exit. The result is that performance monitoring tools in the guest could get false information about where a program was executing

[PULL 05/51] KVM: PPC: Book3S HV: Implement H_CONFER

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org The H_CONFER hypercall is used when a guest vcpu is spinning on a lock held by another vcpu which has been preempted, and the spinning vcpu wishes to give its timeslice to the lock holder. We implement this in the straightforward way using

[PULL 44/51] kvm: powerpc: book3s: Cleanup interrupt handling code

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com With this patch if HV is included, interrupts come in to the HV version of the kvmppc_interrupt code, which then jumps to the PR handler, renamed to kvmppc_interrupt_pr, if the guest is a PR guest. This helps in enabling both HV and PR, which

[PULL 49/51] kvm: Add struct kvm arg to memslot APIs

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com We will use that in the later patch to find the kvm ops handler Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/arm/kvm/arm.c | 5 +++--

[PULL 41/51] kvm: powerpc: book3s: pr: Rename KVM_BOOK3S_PR to KVM_BOOK3S_PR_POSSIBLE

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com With later patches supporting PR kvm as a kernel module, the changes that has to be built into the main kernel binary to enable PR KVM module is now selected via KVM_BOOK3S_PR_POSSIBLE Signed-off-by: Aneesh Kumar K.V

[PULL 42/51] kvm: powerpc: book3s: Add a new config variable CONFIG_KVM_BOOK3S_HV_POSSIBLE

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This help ups to select the relevant code in the kernel code when we later move HV and PR bits as seperate modules. The patch also makes the config options for PR KVM selectable Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com

[PULL 51/51] kvm: powerpc: book3s: drop is_hv_enabled

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com drop is_hv_enabled, because that should not be a callback property Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_ppc.h | 6 +-

[PULL 34/51] powerpc: move debug registers in a structure

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com This way we can use same data type struct with KVM and also help in using other debug related function. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/processor.h | 38

[PULL 35/51] powerpc: export debug registers save function for KVM

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com KVM need this function when switching from vcpu to user-space thread. My subsequent patch will use this function. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Acked-by: Michael Neuling mi...@neuling.org Signed-off-by: Alexander Graf

[PULL 31/51] kvm: powerpc: allow guest control G attribute in mas2

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com G bit in MAS2 indicates whether the page is Guarded. There is no reason to stop guest setting G, so allow him. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/e500.h | 2 +- 1

[PULL 47/51] kvm: powerpc: booke: Move booke related tracepoints to separate header

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/booke.c | 4 +- arch/powerpc/kvm/e500_mmu.c | 2 +- arch/powerpc/kvm/e500_mmu_host.c | 3 +-

[PULL 50/51] kvm: powerpc: book3s: Allow the HV and PR selection per virtual machine

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com This moves the kvmppc_ops callbacks to be a per VM entity. This enables us to select HV and PR mode when creating a VM. We also allow both kvm-hv and kvm-pr kernel module to be loaded. To achieve this we move /dev/kvm ownership to kvm.ko

[PULL 48/51] kvm: powerpc: book3s: Support building HV and PR KVM as module

2013-10-31 Thread Alexander Graf
From: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com [agraf: squash in compile fix] Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/Kconfig | 6 +++--- arch/powerpc/kvm/Makefile | 11 ---

[PULL 36/51] KVM: PPC: E500: exit to user space on ehpriv 1 instruction

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com ehpriv 1 instruction is used for setting software breakpoints by user space. This patch adds support to exit to user space with run-debug have relevant information. As this is the first point we are using run-debug, also defined the run-debug structure.

[PULL 28/51] KVM: PPC: Book3S HV: Better handling of exceptions that happen in real mode

2013-10-31 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org When an interrupt or exception happens in the guest that comes to the host, the CPU goes to hypervisor real mode (MMU off) to handle the exception but doesn't change the MMU context. After saving a few registers, we then clear the in guest flag. If, for any

[PULL 38/51] KVM: PPC: E500: Add userspace debug stub support

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com This patch adds the debug stub support on booke/bookehv. Now QEMU debug stub can use hw breakpoint, watchpoint and software breakpoint to debug guest. This is how we save/restore debug register context when switching between guest, userspace and kernel

[PULL 37/51] KVM: PPC: E500: Using struct debug_reg

2013-10-31 Thread Alexander Graf
From: Bharat Bhushan r65...@freescale.com For KVM also use the struct debug_reg defined in asm/processor.h Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/asm/kvm_host.h | 13 + arch/powerpc/kvm/booke.c

  1   2   >