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

2014-10-16 Thread kernelfans
Signed-off-by: Liu Ping Fan --- 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 +93,10 @@ config KVM_BOOK3S_64_

[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 --- arch/powerpc/kvm/book3s_hv.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/k

[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 --- arch/powerpc/kvm/book3s_hv_rmhandlers.S | 6 ++ 1 file changed, 6 insertions(+) diff --git a/ar

[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 --- arch/powerpc/include/asm/kvm_host.h | 3 +++ arch/powerpc/kernel/asm-offsets.c | 3 +++ arch/powerpc/kvm/book3s_hv_

[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 --- arch/powerpc/kvm/book3s_hv.c

[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 --- arch/powerpc/include/asm/paca.h | 3 ++

[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 s

[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. I

[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 --- arch/powerpc/kernel/sysfs.c

[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 --- arch/powerpc/include/asm/kvm_host.h | 3 +++ arch/powerpc/kvm/book3s_hv.c| 17 + 2 files changed, 20 insertions(+) diff --git a/arch/powerpc/include/a

[RFC 01/11] sched: introduce sys_cpumask in tsk to adapt asymmetric system

2014-10-16 Thread kernelfans
Some system such as powerpc, some tsk (vcpu thread) can only run on the dedicated cpu. Since we adapt some asymmetric method to monitor the whole physical cpu. (powerKVM only allows the primary hwthread to set up runtime env for the secondary when entering guest). Nowadays, powerKVM run with all t

[RFC 00/11]: powerKVM, release the compute power of secondary hwthread on host

2014-10-16 Thread kernelfans
Nowadays, when running powerKVM(book3s, hv mode), we should make the secondary hwthread offline. Which means that if we run misc tsks other than dedicated KVM (e.g mix java and KVM), we will lose the compute power of the secondary hwthread on host env. This series aim to make the powerpc adapti