Re: [RFC 03/11] powerpc: kvm: add interface to control kvm function on a core

2014-10-26 Thread Preeti U Murthy
Hi Liu, On 10/17/2014 12:59 AM, kernelf...@gmail.com wrote: When kvm is enabled on a core, we migrate all external irq to primary thread. Since currently, the kvmirq logic is handled by the primary hwthread. Todo: this patch lacks re-enable of irqbalance when kvm is disable on the core

Re: [RFC 04/11] powerpc: kvm: introduce a kthread on primary thread to anti tickless

2014-10-26 Thread Preeti U Murthy
On 10/17/2014 12:59 AM, kernelf...@gmail.com wrote: (This patch is a place holder.) If there is only one vcpu thread is ready(the other vcpu thread can wait for it to execute), the primary thread can enter tickless mode, We do not configure NOHZ_FULL to y by default. Hence no thread would

Re: [RFC 06/11] powerpc: kvm: introduce online in paca to indicate whether cpu is needed by host

2014-10-26 Thread Preeti U Murthy
Hi Liu, On 10/17/2014 12:59 AM, kernelf...@gmail.com wrote: Nowadays, powerKVM runs with secondary hwthread offline. Although we can make all secondary hwthread online later, we still preserve this behavior for dedicated KVM env. Achieve this by setting paca-online as false. Signed-off-by:

Re: [RFC 07/11] powerpc: kvm: the stopper func to cease secondary hwthread

2014-10-22 Thread Preeti U Murthy
Hi Liu, On 10/17/2014 12:59 AM, kernelf...@gmail.com wrote: To enter guest, primary hwtherad schedules the stopper func on secondary threads and force them into NAP mode. When exit to host,secondary threads hardcode to restore the stack, then switch back to the stopper func, i.e host.

[PATCH v12 0/6] arm/KVM: dirty page logging support for ARMv7 (3.17.0-rc1)

2014-10-22 Thread Mario Smarduch
This patch series introduces dirty page logging for ARMv7 and adds some degree of generic dirty logging support for x86, armv7 and later armv8. I implemented Alex's suggestion after he took a look at the patches at kvm forum to simplify the generic/arch split - leaving mips, powerpc, s390,

[PATCH v12 2/6] KVM: Add generic support for dirty page logging

2014-10-22 Thread Mario Smarduch
This patch defines KVM_GENERIC_DIRTYLOG, and moves dirty log read function to it's own file virt/kvm/dirtylog.c. x86 is updated to use the generic dirty log interface, selecting KVM_GENERIC_DIRTYLOG in its Kconfig and makefile. No other architectures are affected, each uses it's own version. This

[PATCH v12 1/6] KVM: Add architecture-defined TLB flush support

2014-10-22 Thread Mario Smarduch
This patch adds support for architecture implemented VM TLB flush, currently ARMv7 defines HAVE_KVM_ARCH_TLB_FLUSH_ALL. This leaves other architectures unaffected using the generic version. In subsequent patch ARMv7 defines HAVE_KVM_ARCH_TLB_FLUSH_ALL and it's own TLB flush interface.

[PATCH v12 3/6] arm: KVM: Add ARMv7 API to flush TLBs

2014-10-22 Thread Mario Smarduch
This patch adds ARMv7 architecture TLB Flush function. Acked-by: Christoffer Dall christoffer.dall at linaro.org Signed-off-by: Mario Smarduch m.smard...@samsung.com --- arch/arm/include/asm/kvm_asm.h |1 + arch/arm/include/asm/kvm_host.h | 12 arch/arm/kvm/Kconfig

[PATCH v12 4/6] arm: KVM: Add initial dirty page locking infrastructure

2014-10-22 Thread Mario Smarduch
Patch adds support for initial write protection of VM memlsot. This patch series assumes that huge PUDs will not be used in 2nd stage tables, which is awlays valid on ARMv7. Signed-off-by: Mario Smarduch m.smard...@samsung.com --- arch/arm/include/asm/kvm_host.h |2 +

[PATCH v12 6/6] arm: KVM: ARMv7 dirty page logging 2nd stage page fault

2014-10-22 Thread Mario Smarduch
This patch adds support for handling 2nd stage page faults during migration, it disables faulting in huge pages, and dissolves huge pages to page tables. In case migration is canceled huge pages are used again. Reviewed-by: Christoffer Dall christoffer.dall at linaro.org Signed-off-by: Mario

[PATCH v12 5/6] arm: KVM: dirty log read write protect support

2014-10-22 Thread Mario Smarduch
This patch adds support to track VM dirty pages, between dirty log reads. Pages that have been dirtied since last log read are write protected again, in preparation of next dirty log read. In addition ARMv7 dirty log read function is pushed up to generic layer. Signed-off-by: Mario Smarduch

[PATCH] KVM: PPC: Book3S HV: Add missing HPTE unlock

2014-10-20 Thread Aneesh Kumar K.V
In kvm_test_clear_dirty_npages(), if we find an invalid HPTE we move on to the next HPTE without unlocking the invalid one. In fact we should never find an invalid and unlocked HPTE in the rmap chain, but for robustness we should unlock it. This adds the missing unlock. Reported-by: Benjamin

[PATCH 3/3] KVM: PPC: BOOK3S: HV: Rename variable for better readability

2014-10-20 Thread Aneesh Kumar K.V
Minor cleanup Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_hv_rm_mmu.c | 25 + 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c index

[PATCH 2/3] KVM: PPC: BOOK3S: HV: Use unlock variant with memory barrier

2014-10-20 Thread Aneesh Kumar K.V
We switch to unlock variant with memory barriers in the error path and also in code path where we had implicit dependency on previous functions calling lwsync/ptesync. In most of the cases we don't really need an explicit barrier, but using the variant make sure we don't make mistakes later with

[PATCH 1/3] KVM: PPC: BOOK3S: HV: Add helpers for lock/unlock hpte

2014-10-20 Thread Aneesh Kumar K.V
This patch adds helper routine for lock and unlock hpte and use the same for rest of the code. We don't change any locking rules in this patch. In the next patch we switch some of the unlock usage to use the api with barrier and also document the usage without barriers. Signed-off-by: Aneesh

[RFC 07/11] powerpc: kvm: the stopper func to cease secondary hwthread

2014-10-16 Thread kernelfans
To enter guest, primary hwtherad schedules the stopper func on secondary threads and force them into NAP mode. When exit to host,secondary threads hardcode to restore the stack, then switch back to the stopper func, i.e host. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com ---

[RFC 09/11] powerpc: kvm: handle time base on secondary hwthread

2014-10-16 Thread kernelfans
(This is a place holder patch.) We need to store the time base for host on secondary hwthread. Later when switching back, we need to reprogram it with elapse time. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 6 ++ 1 file changed, 6

[RFC 05/11] sched: introduce stop_cpus_async() to schedule special tsk on cpu

2014-10-16 Thread kernelfans
The proto will be: cpu1 cpuX stop_cpus_async() bring cpuX to a special state signal flag and trapped check for flag The func help powerpc to reuse the scheme of cpu_stopper_task to force the

[RFC 03/11] powerpc: kvm: add interface to control kvm function on a core

2014-10-16 Thread kernelfans
When kvm is enabled on a core, we migrate all external irq to primary thread. Since currently, the kvmirq logic is handled by the primary hwthread. Todo: this patch lacks re-enable of irqbalance when kvm is disable on the core Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com ---

[RFC 04/11] powerpc: kvm: introduce a kthread on primary thread to anti tickless

2014-10-16 Thread kernelfans
(This patch is a place holder.) If there is only one vcpu thread is ready(the other vcpu thread can wait for it to execute), the primary thread can enter tickless mode, which causes the primary keeps running, so the secondary has no opportunity to exit to host, even they have other tsk on them.

[RFC 11/11] powerpc: kvm: Kconfig add an option for enabling secondary hwthread

2014-10-16 Thread kernelfans
Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- arch/powerpc/kvm/Kconfig | 4 1 file changed, 4 insertions(+) diff --git a/arch/powerpc/kvm/Kconfig b/arch/powerpc/kvm/Kconfig index 602eb51..de38566 100644 --- a/arch/powerpc/kvm/Kconfig +++ b/arch/powerpc/kvm/Kconfig @@ -93,6

[RFC 06/11] powerpc: kvm: introduce online in paca to indicate whether cpu is needed by host

2014-10-16 Thread kernelfans
Nowadays, powerKVM runs with secondary hwthread offline. Although we can make all secondary hwthread online later, we still preserve this behavior for dedicated KVM env. Achieve this by setting paca-online as false. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com ---

[RFC 08/11] powerpc: kvm: add a flag in vcore to sync primary with secondry hwthread

2014-10-16 Thread kernelfans
The secondary thread can only jump back to host until primary has set up the env. Add host_ready field in kvm_vcore to sync this action. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_host.h | 3 +++ arch/powerpc/kernel/asm-offsets.c | 3 +++

[RFC 02/11] powerpc: kvm: ensure vcpu-thread run only on primary hwthread

2014-10-16 Thread kernelfans
When vcpu thread runs at the first time, it will ensure to stick to the primary thread. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- arch/powerpc/include/asm/kvm_host.h | 3 +++ arch/powerpc/kvm/book3s_hv.c| 17 + 2 files changed, 20 insertions(+) diff

[RFC 10/11] powerpc: kvm: on_primary_thread() force the secondary threads into NAP mode

2014-10-16 Thread kernelfans
The primary hwthread ceases the scheduler of secondary hwthread by bringing them into NAP. Then, the secondary is ready for guest. Signed-off-by: Liu Ping Fan pingf...@linux.vnet.ibm.com --- arch/powerpc/kvm/book3s_hv.c | 7 +++ 1 file changed, 7 insertions(+) diff --git

Re: [PATCH] KVM: PPC: Book3S HV: return htab entries in big endian

2014-10-03 Thread Paul Mackerras
On Thu, Oct 02, 2014 at 07:06:40PM +0200, Alexander Graf wrote: I think we're best off to keep the user space API native endian. So really we should only ever have to convert from big to native endian on read and native to big on write. With that QEMU should do the right thing already, no?

Re: [PATCH] KVM: PPC: Book3S HV: return htab entries in big endian

2014-10-03 Thread Alexander Graf
Am 03.10.2014 um 14:05 schrieb Paul Mackerras pau...@samba.org: On Thu, Oct 02, 2014 at 07:06:40PM +0200, Alexander Graf wrote: I think we're best off to keep the user space API native endian. So really we should only ever have to convert from big to native endian on read and native to

Re: [PATCH] KVM: PPC: Book3S HV: return htab entries in big endian

2014-10-03 Thread Alexey Kardashevskiy
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 10/04/2014 07:05 AM, Alexander Graf wrote: Am 03.10.2014 um 14:05 schrieb Paul Mackerras pau...@samba.org: On Thu, Oct 02, 2014 at 07:06:40PM +0200, Alexander Graf wrote: I think we're best off to keep the user space API native endian.

A1-X1000 Nemo: Mac-on-Linux/KVM-PR works!!!!!!!!!!!!!!!!!!!!!

2014-10-02 Thread Christian Zigotzky
Mac OS X boots with MoL/PR KVM on an AmigaONE X1000 PowerPC (YouTube video): http://youtu.be/7alchoY6kzY -- To unsubscribe from this list: send the line unsubscribe kvm-ppc in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH] KVM: PPC: Book3S HV: return htab entries in big endian

2014-10-02 Thread Cédric Le Goater
Saving and restoring guests on a KVM little endian host is currently broken because qemu assumes that htabs are big endian. This patch modifies kvm_htab_read and kvm_htab_write to make sure that the endianness expected by qemu is enforced on big and little endian hosts. Signed-off-by: Cédric

Re: [PATCH] KVM: PPC: Book3S HV: return htab entries in big endian

2014-10-02 Thread Alexander Graf
On 02.10.14 18:58, Cédric Le Goater wrote: Saving and restoring guests on a KVM little endian host is currently broken because qemu assumes that htabs are big endian. This patch modifies kvm_htab_read and kvm_htab_write to make sure that the endianness expected by qemu is enforced on

Re: [PATCH] KVM: PPC: BOOK3S: HV: CMA: Reserve cma region only in hypervisor mode

2014-09-29 Thread Alexander Graf
On 29.09.14 10:02, Aneesh Kumar K.V wrote: We use cma reserved area for creating guest hash page table. Don't do the reservation in non-hypervisor mode. This avoids unnecessary CMA reservation when booting with limited memory configs like fadump and kdump. Signed-off-by: Aneesh Kumar K.V

Re: [PATCH] KVM: PPC: BOOK3S: HV: CMA: Reserve cma region only in hypervisor mode

2014-09-29 Thread Paolo Bonzini
Il 29/09/2014 10:28, Alexander Graf ha scritto: On 29.09.14 10:02, Aneesh Kumar K.V wrote: We use cma reserved area for creating guest hash page table. Don't do the reservation in non-hypervisor mode. This avoids unnecessary CMA reservation when booting with limited memory configs like

Re: [PATCH] KVM: PPC: BOOK3S: HV: CMA: Reserve cma region only in hypervisor mode

2014-09-29 Thread Alexander Graf
On 29.09.14 13:48, Paolo Bonzini wrote: Il 29/09/2014 10:28, Alexander Graf ha scritto: On 29.09.14 10:02, Aneesh Kumar K.V wrote: We use cma reserved area for creating guest hash page table. Don't do the reservation in non-hypervisor mode. This avoids unnecessary CMA reservation when

Re: [PATCH] KVM: PPC: BOOK3S: HV: CMA: Reserve cma region only in hypervisor mode

2014-09-29 Thread Paolo Bonzini
Il 29/09/2014 13:57, Alexander Graf ha scritto: On 29.09.14 13:48, Paolo Bonzini wrote: Il 29/09/2014 10:28, Alexander Graf ha scritto: On 29.09.14 10:02, Aneesh Kumar K.V wrote: We use cma reserved area for creating guest hash page table. Don't do the reservation in non-hypervisor

[PULL 13/24] KVM: PPC: Make ONE_REG powerpc generic

2014-09-24 Thread Alexander Graf
From: Mihai Caraman mihai.cara...@freescale.com Make ONE_REG generic for server and embedded architectures by moving kvm_vcpu_ioctl_get_one_reg() and kvm_vcpu_ioctl_set_one_reg() functions to powerpc layer. Signed-off-by: Mihai Caraman mihai.cara...@freescale.com Signed-off-by: Alexander Graf

[PULL 21/24] KVM: PPC: Book3E: Enable e6500 core

2014-09-24 Thread Alexander Graf
From: Mihai Caraman mihai.cara...@freescale.com Now that AltiVec and hardware thread support is in place enable e6500 core. Signed-off-by: Mihai Caraman mihai.cara...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/kvm/e500mc.c | 10 ++ 1 file changed, 10

[PULL 16/24] KVM: PPC: Remove the tasklet used by the hrtimer

2014-09-24 Thread Alexander Graf
From: Mihai Caraman mihai.cara...@freescale.com Powerpc timer implementation is a copycat version of s390. Now that they removed the tasklet with commit ea74c0ea1b24a6978a6ebc80ba4dbc7b7848b32d follow this optimization. Signed-off-by: Mihai Caraman mihai.cara...@freescale.com Signed-off-by:

[PULL 11/24] KVM: PPC: Book3E: Increase FPU laziness

2014-09-24 Thread Alexander Graf
From: Mihai Caraman mihai.cara...@freescale.com Increase FPU laziness by loading the guest state into the unit before entering the guest instead of doing it on each vcpu schedule. Without this improvement an interrupt may claim floating point corrupting guest state. Signed-off-by: Mihai Caraman

[PULL 19/24] KVM: PPC: Book3S HV: Only accept host PVR value for guest PVR

2014-09-24 Thread Alexander Graf
From: Paul Mackerras pau...@samba.org Since the guest can read the machine's PVR (Processor Version Register) directly and see the real value, we should disallow userspace from setting any value for the guest's PVR other than the real host value. Therefore this makes kvm_arch_vcpu_set_sregs_hv()

[PULL 09/24] KVM: PPC: Book3S HV: Add register name when loading toc

2014-09-24 Thread Alexander Graf
From: Michael Neuling mi...@neuling.org Add 'r' to register name r2 in kvmppc_hv_enter. Also update comment at the top of kvmppc_hv_enter to indicate that R2/TOC is non-volatile. Signed-off-by: Michael Neuling mi...@neuling.org Signed-off-by: Paul Mackerras pau...@samba.org Signed-off-by:

[PULL 12/24] KVM: PPC: Book3e: Add AltiVec support

2014-09-24 Thread Alexander Graf
From: Mihai Caraman mihai.cara...@freescale.com Add AltiVec support in KVM for Book3e. FPU support gracefully reuse host infrastructure so follow the same approach for AltiVec. Book3e specification defines shared interrupt numbers for SPE and AltiVec units. Still SPE is present in e200/e500v2

[PULL 18/24] KVM: PPC: Book3S HV: Increase timeout for grabbing secondary threads

2014-09-24 Thread Alexander Graf
From: Paul Mackerras pau...@au1.ibm.com Occasional failures have been seen with split-core mode and migration where the message KVM: couldn't grab cpu appears. This increases the length of time that we wait from 1ms to 10ms, which seems to work around the issue. Signed-off-by: Paul Mackerras

[PULL 07/24] powerpc/booke: Restrict SPE exception handlers to e200/e500 cores

2014-09-24 Thread Alexander Graf
From: Mihai Caraman mihai.cara...@freescale.com SPE exception handlers are now defined for 32-bit e500mc cores even though SPE unit is not present and CONFIG_SPE is undefined. Restrict SPE exception handlers to e200/e500 cores adding CONFIG_SPE_POSSIBLE and consequently guard __stup_ivors and

[PULL 20/24] KVM: PPC: e500mc: Add support for single threaded vcpus on e6500 core

2014-09-24 Thread Alexander Graf
From: Mihai Caraman mihai.cara...@freescale.com ePAPR represents hardware threads as cpu node properties in device tree. So with existing QEMU, hardware threads are simply exposed as vcpus with one hardware thread. The e6500 core shares TLBs between hardware threads. Without tlb write

[PULL 10/24] KVM: PPC: BOOKE: Add one_reg documentation of SPRG9 and DBSR

2014-09-24 Thread Alexander Graf
From: Bharat Bhushan bharat.bhus...@freescale.com This was missed in respective one_reg implementation patch. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- Documentation/virtual/kvm/api.txt | 2 ++ 1 file changed, 2 insertions(+)

[PULL 24/24] KVM: PPC: Pass enum to kvmppc_get_last_inst

2014-09-24 Thread Alexander Graf
The kvmppc_get_last_inst function recently received a facelift that allowed us to pass an enum of the type of instruction we want to read into it rather than an unreadable boolean. Unfortunately, not all callers ended up passing the enum. This wasn't really an issue as true and false happen to

[PULL 14/24] KVM: PPC: Move ONE_REG AltiVec support to powerpc

2014-09-24 Thread Alexander Graf
From: Mihai Caraman mihai.cara...@freescale.com Move ONE_REG AltiVec support to powerpc generic layer. Signed-off-by: Mihai Caraman mihai.cara...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/uapi/asm/kvm.h | 5 + arch/powerpc/kvm/book3s.c |

[PULL 04/24] KVM: PPC: BOOKE: Clear guest dbsr in userspace exit KVM_EXIT_DEBUG

2014-09-24 Thread Alexander Graf
From: Bharat Bhushan bharat.bhus...@freescale.com Dbsr is not visible to userspace and we do not think any need to expose this to userspace because: Userspace cannot inject debug interrupt to guest (as this does not know guest ability to handle debug interrupt), so userspace will always

[PULL 06/24] KVM: PPC: BOOKE: Add one reg interface for DBSR

2014-09-24 Thread Alexander Graf
From: Bharat Bhushan bharat.bhus...@freescale.com Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com Signed-off-by: Alexander Graf ag...@suse.de --- arch/powerpc/include/uapi/asm/kvm.h | 1 + arch/powerpc/kvm/booke.c| 6 ++ 2 files changed, 7 insertions(+) diff --git

[PULL 01/24] KVM: PPC: BOOKE: allow debug interrupt at debug level

2014-09-24 Thread Alexander Graf
From: Bharat Bhushan bharat.bhus...@freescale.com Debug interrupt can be either critical level or debug level. There are separate set of save/restore registers used for different level. Example: DSRR0/DSRR1 are used for debug level and CSRR0/CSRR1 are used for critical level debug interrupt.

[PULL 08/24] powerpc/booke: Revert SPE/AltiVec common defines for interrupt numbers

2014-09-24 Thread Alexander Graf
From: Mihai Caraman mihai.cara...@freescale.com Book3E specification defines shared interrupt numbers for SPE and AltiVec units. Still SPE is present in e200/e500v2 cores while AltiVec is present in e6500 core. So we can currently decide at compile-time which unit to support exclusively. As

[PULL 03/24] KVM: PPC: BOOKE: Allow guest to change MSR_DE

2014-09-24 Thread Alexander Graf
From: Bharat Bhushan bharat.bhus...@freescale.com This patch changes the default behavior of MSRP_DEP, that is guest is not allowed to change the MSR_DE, to guest can change MSR_DE. When userspace is debugging guest then it override the default behavior and set MSRP_DEP. This stops guest to

[PULL 00/24] ppc patch queue 2014-09-24

2014-09-24 Thread Alexander Graf
Hi Paolo, This is my current patch queue for ppc. Please pull. Alex The following changes since commit f51770ed465e6eb41da7fa16fd92eb67069600cf: kvm: Make init_rmode_identity_map() return 0 on success. (2014-09-17 13:10:12 +0200) are available in the git repository at:

[PULL 17/24] KVM: PPC: Remove shared defines for SPE and AltiVec interrupts

2014-09-24 Thread Alexander Graf
From: Mihai Caraman mihai.cara...@freescale.com We currently decide at compile-time which of the SPE or AltiVec units to support exclusively. Guard kernel defines with CONFIG_SPE_POSSIBLE and CONFIG_PPC_E500MC and remove shared defines. Signed-off-by: Mihai Caraman mihai.cara...@freescale.com

[PULL 23/24] powerpc/kvm: common sw breakpoint instr across ppc

2014-09-24 Thread Alexander Graf
From: Madhavan Srinivasan ma...@linux.vnet.ibm.com This patch extends the use of illegal instruction as software breakpoint instruction across the ppc platform. Patch extends booke program interrupt code to support software breakpoint. Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com

[PULL 15/24] KVM: PPC: BOOKE: Emulate debug registers and exception

2014-09-24 Thread Alexander Graf
From: Bharat Bhushan bharat.bhus...@freescale.com This patch emulates debug registers and debug exception to support guest using debug resource. This enables running gdb/kgdb etc in guest. On BOOKE architecture we cannot share debug resources between QEMU and guest because: When QEMU is

Re: [PULL 00/24] ppc patch queue 2014-09-24

2014-09-24 Thread Paolo Bonzini
Il 24/09/2014 22:43, Alexander Graf ha scritto: Hi Paolo, This is my current patch queue for ppc. Please pull. Alex The following changes since commit f51770ed465e6eb41da7fa16fd92eb67069600cf: kvm: Make init_rmode_identity_map() return 0 on success. (2014-09-17 13:10:12 +0200)

Re: [PATCH] KVM: PPC: Convert openpic lock to raw_spinlock

2014-09-12 Thread Scott Wood
On Fri, 2014-09-12 at 09:12 -0500, Purcareata Bogdan-B43198 wrote: -Original Message- From: Wood Scott-B07421 Sent: Thursday, September 11, 2014 9:19 PM To: Purcareata Bogdan-B43198 Cc: kvm-ppc@vger.kernel.org; k...@vger.kernel.org Subject: Re: [PATCH] KVM: PPC: Convert openpic

[PATCH] KVM: PPC: Convert openpic lock to raw_spinlock

2014-09-11 Thread Bogdan Purcareata
This patch enables running intensive I/O workloads, e.g. netperf, in a guest deployed on a RT host. No change for !RT kernels. The openpic spinlock becomes a sleeping mutex on a RT system. This no longer guarantees that EPR is atomic with exception delivery. The guest VCPU thread fails due to a

Re: [PATCH] KVM: PPC: Convert openpic lock to raw_spinlock

2014-09-11 Thread Scott Wood
On Thu, 2014-09-11 at 15:25 -0400, Bogdan Purcareata wrote: This patch enables running intensive I/O workloads, e.g. netperf, in a guest deployed on a RT host. No change for !RT kernels. The openpic spinlock becomes a sleeping mutex on a RT system. This no longer guarantees that EPR is

Re: [PATCH 2/2 v6] powerpc/kvm: common sw breakpoint instr across ppc

2014-09-10 Thread Alexander Graf
On 09.09.14 19:07, Madhavan Srinivasan wrote: This patch extends the use of illegal instruction as software breakpoint instruction across the ppc platform. Patch extends booke program interrupt code to support software breakpoint. Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com

[PATCH] KVM: PPC: Pass enum to kvmppc_get_last_inst

2014-09-10 Thread Alexander Graf
The kvmppc_get_last_inst function recently received a facelift that allowed us to pass an enum of the type of instruction we want to read into it rather than an unreadable boolean. Unfortunately, not all callers ended up passing the enum. This wasn't really an issue as true and false happen to

Re: [PATCH 1/2 v5] powerpc/kvm: support to handle sw breakpoint

2014-09-09 Thread Madhavan Srinivasan
On Monday 08 September 2014 06:35 PM, Alexander Graf wrote: On 07.09.14 18:31, Madhavan Srinivasan wrote: This patch adds kernel side support for software breakpoint. Design is that, by using an illegal instruction, we trap to hypervisor via Emulation Assistance interrupt, where we check

Re: [PATCH 2/2 v5] powerpc/kvm: common sw breakpoint instr across ppc

2014-09-09 Thread Madhavan Srinivasan
On Monday 08 September 2014 06:39 PM, Alexander Graf wrote: On 07.09.14 18:31, Madhavan Srinivasan wrote: This patch extends the use of illegal instruction as software breakpoint instruction across the ppc platform. Patch extends booke program interrupt code to support software breakpoint.

[PATCH 2/2 v6] powerpc/kvm: common sw breakpoint instr across ppc

2014-09-09 Thread Madhavan Srinivasan
This patch extends the use of illegal instruction as software breakpoint instruction across the ppc platform. Patch extends booke program interrupt code to support software breakpoint. Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com --- Patch is only compile tested. Will really help

[PATCH 0/2 v6] powerpc/kvm: support to handle sw breakpoint

2014-09-09 Thread Madhavan Srinivasan
This patchset adds ppc64 server side support for software breakpoint and extends the use of illegal instruction as software breakpoint across ppc platform. Patch 1, adds kernel side support for software breakpoint. Design is that, by using an illegal instruction, we trap to hypervisor via

[PATCH 1/2 v6] powerpc/kvm: support to handle sw breakpoint

2014-09-09 Thread Madhavan Srinivasan
This patch adds kernel side support for software breakpoint. Design is that, by using an illegal instruction, we trap to hypervisor via Emulation Assistance interrupt, where we check for the illegal instruction and accordingly we return to Host or Guest. Patch also adds support for software

Re: [PATCH 1/2 v6] powerpc/kvm: support to handle sw breakpoint

2014-09-09 Thread Alexander Graf
On 09.09.14 19:07, Madhavan Srinivasan wrote: This patch adds kernel side support for software breakpoint. Design is that, by using an illegal instruction, we trap to hypervisor via Emulation Assistance interrupt, where we check for the illegal instruction and accordingly we return to Host

Re: [PATCH 0/2 v6] powerpc/kvm: support to handle sw breakpoint

2014-09-09 Thread Alexander Graf
On 09.09.14 19:07, Madhavan Srinivasan wrote: This patchset adds ppc64 server side support for software breakpoint and extends the use of illegal instruction as software breakpoint across ppc platform. Patch 1, adds kernel side support for software breakpoint. Design is that, by using an

Re: [PATCH 1/2 v5] powerpc/kvm: support to handle sw breakpoint

2014-09-08 Thread Alexander Graf
On 07.09.14 18:31, Madhavan Srinivasan wrote: This patch adds kernel side support for software breakpoint. Design is that, by using an illegal instruction, we trap to hypervisor via Emulation Assistance interrupt, where we check for the illegal instruction and accordingly we return to Host

Re: [PATCH 2/2 v5] powerpc/kvm: common sw breakpoint instr across ppc

2014-09-08 Thread Alexander Graf
On 07.09.14 18:31, Madhavan Srinivasan wrote: This patch extends the use of illegal instruction as software breakpoint instruction across the ppc platform. Patch extends booke program interrupt code to support software breakpoint. Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com

[PATCH 0/2 v5] powerpc/kvm: support to handle sw breakpoint

2014-09-07 Thread Madhavan Srinivasan
This patchset adds ppc64 server side support for software breakpoint and extends the use of illegal instruction as software breakpoint across ppc platform. Patch 1, adds kernel side support for software breakpoint. Design is that, by using an illegal instruction, we trap to hypervisor via

[PATCH 1/2 v5] powerpc/kvm: support to handle sw breakpoint

2014-09-07 Thread Madhavan Srinivasan
This patch adds kernel side support for software breakpoint. Design is that, by using an illegal instruction, we trap to hypervisor via Emulation Assistance interrupt, where we check for the illegal instruction and accordingly we return to Host or Guest. Patch also adds support for software

[PATCH 2/2 v5] powerpc/kvm: common sw breakpoint instr across ppc

2014-09-07 Thread Madhavan Srinivasan
This patch extends the use of illegal instruction as software breakpoint instruction across the ppc platform. Patch extends booke program interrupt code to support software breakpoint. Signed-off-by: Madhavan Srinivasan ma...@linux.vnet.ibm.com --- Patch is only compile tested. Will really help

Patch - support e500-specific: Performance monitor

2014-09-04 Thread Amit Tomar
Is There specific any reason not to copy extra handler IOVR 35 for e500? --- a/arch/powerpc/kvm/e500.c +++ b/arch/powerpc/kvm/e500.c @@ -527,7 +527,7 @@ static struct kvmppc_ops kvm_ops_e500 = { static int __init kvmppc_e500_init(void) { int r, i; - unsigned long ivor[3]; +

RE: Patch - support e500-specific: Performance monitor

2014-09-04 Thread bharat.bhus...@freescale.com
-Original Message- From: kvm-ppc-ow...@vger.kernel.org [mailto:kvm-ppc-ow...@vger.kernel.org] On Behalf Of Amit Tomar Sent: Thursday, September 04, 2014 8:34 PM To: ag...@suse.de; kvm-ppc@vger.kernel.org; Caraman Mihai Claudiu-B02008; pbonz...@redhat.com Subject: Patch - support

Re: [PATCH] powerpc/kvm/cma: Fix panic introduces by signed shift operation

2014-09-03 Thread Paolo Bonzini
Il 02/09/2014 18:13, Laurent Dufour ha scritto: fc95ca7284bc54953165cba76c3228bd2cdb9591 introduces a memset in kvmppc_alloc_hpt since the general CMA doesn't clear the memory it allocates. However, the size argument passed to memset is computed from a signed value and its signed bit is

Re: [PATCH v2 1/2] KVM: PPC: e500mc: Add support for single threaded vcpus on e6500 core

2014-09-03 Thread Alexander Graf
On 01.09.14 11:01, Mihai Caraman wrote: ePAPR represents hardware threads as cpu node properties in device tree. So with existing QEMU, hardware threads are simply exposed as vcpus with one hardware thread. The e6500 core shares TLBs between hardware threads. Without tlb write conditional

[PATCH 0/3] KVM: PPC: Book3S: Some miscellanous fixes

2014-09-02 Thread Paul Mackerras
This series of patches is based on Alex Graf's kvm-ppc-queue branch. It contains 3 small patches from the tree that we are shipping on POWER8 machines: a fix for an error that we see very occasionally, and two minor improvements. Please apply for 3.18. Paul. ---

[PATCH 2/3] KVM: PPC: Book3S HV: Only accept host PVR value for guest PVR

2014-09-02 Thread Paul Mackerras
Since the guest can read the machine's PVR (Processor Version Register) directly and see the real value, we should disallow userspace from setting any value for the guest's PVR other than the real host value. Therefore this makes kvm_arch_vcpu_set_sregs_hv() check the supplied PVR value and return

[PATCH 3/3] KVM: PPC: Book3S PR: Implement ARCH_COMPAT register

2014-09-02 Thread Paul Mackerras
This provides basic support for the KVM_REG_PPC_ARCH_COMPAT register in PR KVM. At present the value is sanity-checked when set, but doesn't actually affect anything yet. Implementing this makes it possible to use a qemu command-line argument such as -cpu host,compat=power7 on a POWER8 machine,

[PATCH 1/3] KVM: PPC: Book3S HV: Increase timeout for grabbing secondary threads

2014-09-02 Thread Paul Mackerras
From: Paul Mackerras pau...@au1.ibm.com Occasional failures have been seen with split-core mode and migration where the message KVM: couldn't grab cpu appears. This increases the length of time that we wait from 1ms to 10ms, which seems to work around the issue. Signed-off-by: Paul Mackerras

[PATCH] powerpc/kvm/cma: Fix panic introduces by signed shift operation

2014-09-02 Thread Laurent Dufour
fc95ca7284bc54953165cba76c3228bd2cdb9591 introduces a memset in kvmppc_alloc_hpt since the general CMA doesn't clear the memory it allocates. However, the size argument passed to memset is computed from a signed value and its signed bit is extended by the cast the compiler is doing. This lead to

RE: [PATCH 1/2] KVM: PPC: e500mc: Add support for single threaded vcpus on e6500 core

2014-09-01 Thread mihai.cara...@freescale.com
I abandon this patch, I will send a v2 with a minor fix for 85xx. Mike -Original Message- From: Mihai Caraman [mailto:mihai.cara...@freescale.com] Sent: Friday, August 29, 2014 8:04 PM To: kvm-ppc@vger.kernel.org Cc: k...@vger.kernel.org; Caraman Mihai Claudiu-B02008 Subject:

[PATCH v2 1/2] KVM: PPC: e500mc: Add support for single threaded vcpus on e6500 core

2014-09-01 Thread Mihai Caraman
ePAPR represents hardware threads as cpu node properties in device tree. So with existing QEMU, hardware threads are simply exposed as vcpus with one hardware thread. The e6500 core shares TLBs between hardware threads. Without tlb write conditional instruction, the Linux kernel uses per core

[PATCH v2 2/2] KVM: PPC: Book3E: Enable e6500 core

2014-09-01 Thread Mihai Caraman
Now that AltiVec and hardware thread support is in place enable e6500 core. Signed-off-by: Mihai Caraman mihai.cara...@freescale.com --- v2: - new patch arch/powerpc/kvm/e500mc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/kvm/e500mc.c

Re: [PATCH 2/2] KVM: remove garbage arg to *hardware_{en,dis}able

2014-09-01 Thread Christoffer Dall
On Thu, Aug 28, 2014 at 03:13:03PM +0200, Radim Krčmář wrote: In the beggining was on_each_cpu(), which required an unused argument to kvm_arch_ops.hardware_{en,dis}able, but this was soon forgotten. Remove unnecessary arguments that stem from this. Signed-off-by: Radim Krčmář

[PATCH] KVM: PPC: Remove shared defines for SPE and AltiVec interrupts

2014-09-01 Thread Mihai Caraman
We currently decide at compile-time which of the SPE or AltiVec units to support exclusively. Guard kernel defines with CONFIG_SPE_POSSIBLE and CONFIG_PPC_E500MC and remove shared defines. Signed-off-by: Mihai Caraman mihai.cara...@freescale.com --- arch/powerpc/include/asm/kvm_asm.h | 20

[PATCH] KVM: PPC: Remove the tasklet used by the hrtimer

2014-09-01 Thread Mihai Caraman
Powerpc timer implementation is a copycat version of s390. Now that they removed the tasklet with commit ea74c0ea1b24a6978a6ebc80ba4dbc7b7848b32d follow this optimization. Signed-off-by: Mihai Caraman mihai.cara...@freescale.com Signed-off-by: Bogdan Purcareata bogdan.purcare...@freescale.com ---

Re: [PATCH] KVM: PPC: Remove the tasklet used by the hrtimer

2014-09-01 Thread Alexander Graf
On 01.09.14 16:19, Mihai Caraman wrote: Powerpc timer implementation is a copycat version of s390. Now that they removed the tasklet with commit ea74c0ea1b24a6978a6ebc80ba4dbc7b7848b32d follow this optimization. Signed-off-by: Mihai Caraman mihai.cara...@freescale.com Signed-off-by:

Re: [PATCH] KVM: PPC: Remove shared defines for SPE and AltiVec interrupts

2014-09-01 Thread Alexander Graf
On 01.09.14 12:17, Mihai Caraman wrote: We currently decide at compile-time which of the SPE or AltiVec units to support exclusively. Guard kernel defines with CONFIG_SPE_POSSIBLE and CONFIG_PPC_E500MC and remove shared defines. Signed-off-by: Mihai Caraman mihai.cara...@freescale.com

Re: [PATCH 0/2] KVM: minor cleanup and optimizations

2014-09-01 Thread Alexander Graf
On 28.08.14 15:13, Radim Krčmář wrote: The first patch answers a demand for inline arch functions. (There is a lot of constant functions that could be inlined as well.) Second patch digs a bit into the history of KVM and removes a useless argument that seemed suspicious when preparing the

[PATCH 2/2] KVM: PPC: Book3E: Enable e6500 core

2014-08-29 Thread Mihai Caraman
Now that AltiVec and hardware threading support are in place enable e6500 core. Signed-off-by: Mihai Caraman mihai.cara...@freescale.com --- arch/powerpc/kvm/e500mc.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/arch/powerpc/kvm/e500mc.c b/arch/powerpc/kvm/e500mc.c index

Re: [PATCH v4] KVM: PPC: BOOKE: Emulate debug registers and exception

2014-08-28 Thread Alexander Graf
On 13.08.14 11:09, Bharat Bhushan wrote: This patch emulates debug registers and debug exception to support guest using debug resource. This enables running gdb/kgdb etc in guest. On BOOKE architecture we cannot share debug resources between QEMU and guest because: When QEMU is using

[PATCH 2/2] KVM: remove garbage arg to *hardware_{en,dis}able

2014-08-28 Thread Radim Krčmář
In the beggining was on_each_cpu(), which required an unused argument to kvm_arch_ops.hardware_{en,dis}able, but this was soon forgotten. Remove unnecessary arguments that stem from this. Signed-off-by: Radim Krčmář rkrc...@redhat.com --- arch/arm/include/asm/kvm_host.h | 2 +-

[PATCH 1/2] KVM: static inline empty kvm_arch functions

2014-08-28 Thread Radim Krčmář
Using static inline is going to save few bytes and cycles. For example on powerpc, the difference is 700 B after stripping. (5 kB before) This patch also deals with two overlooked empty functions: kvm_arch_flush_shadow was not removed from arch/mips/kvm/mips.c 2df72e9bc KVM: split

[PATCH 0/2] KVM: minor cleanup and optimizations

2014-08-28 Thread Radim Krčmář
The first patch answers a demand for inline arch functions. (There is a lot of constant functions that could be inlined as well.) Second patch digs a bit into the history of KVM and removes a useless argument that seemed suspicious when preparing the first patch. Radim Krčmář (2): KVM: static

Re: [PATCH v2 1/2] powerpc/booke: Restrict SPE exception handlers to e200/e500 cores

2014-08-27 Thread Alexander Graf
On 20.08.14 15:09, Mihai Caraman wrote: SPE exception handlers are now defined for 32-bit e500mc cores even though SPE unit is not present and CONFIG_SPE is undefined. Restrict SPE exception handlers to e200/e500 cores adding CONFIG_SPE_POSSIBLE and consequently guard __stup_ivors and

Re: [PATCH 2/2] KVM: PPC: Book3S HV: Add register name when loading toc

2014-08-27 Thread Alexander Graf
On 19.08.14 06:59, Michael Neuling wrote: Add 'r' to register name r2 in kvmppc_hv_enter. Also update comment at the top of kvmppc_hv_enter to indicate that R2/TOC is non-volatile. Signed-off-by: Michael Neuling mi...@neuling.org Signed-off-by: Paul Mackerras pau...@samba.org Thanks,

<    4   5   6   7   8   9   10   11   12   13   >