[RFC PATCH 0/4] Enable async page faults on s390

2013-06-10 Thread Dominik Dingel
ce hase to enable the capability. With that knob we can later on disable this feature for live migration. Dominik Dingel (4): PF: Add FAULT_FLAG_RETRY_NOWAIT for guest fault PF: Move architecture specifics to the backends PF: Additional flag for direct page fault inject PF: Intial async

[PATCH 1/4] PF: Add FAULT_FLAG_RETRY_NOWAIT for guest fault

2013-06-10 Thread Dominik Dingel
: Dominik Dingel --- arch/s390/include/asm/processor.h | 7 +++ arch/s390/kvm/kvm-s390.c | 15 +++ arch/s390/mm/fault.c | 29 + arch/s390/mm/pgtable.c| 1 + 4 files changed, 48 insertions(+), 4 deletions(-) diff --git a/arch

[PATCH 4/4] PF: Intial async page fault support on s390x

2013-06-10 Thread Dominik Dingel
This patch adds the handling for async page faults to s390x code. It provides the userspace API to enable, disable or get the status of this feature. Also it includes the diagnose code, called by the guest, to enable async page faults by pfault or disable them. Signed-off-by: Dominik Dingel

[PATCH 3/4] PF: Additional flag for direct page fault inject

2013-06-10 Thread Dominik Dingel
insert the page to the queue. So if we are not able to schedule the async page, we have to remove it from the list again. As this is only when we also have to page in synchronously, the overhead is not really important. Signed-off-by: Dominik Dingel --- arch/x86/kvm/mmu.c | 2 +- include

[PATCH 2/4] PF: Move architecture specifics to the backends

2013-06-10 Thread Dominik Dingel
Current common code use PAGE_OFFSET to indicate a bad host virtual address. This works for x86 but not necessarily on other architectures. So the check is moved into architecture specific code. Todo: - apply to other architectures when applicable Signed-off-by: Dominik Dingel --- arch/s390

[PATCH 2/4] PF: Move architecture specifics to the backends

2013-07-05 Thread Dominik Dingel
Current common codes uses PAGE_OFFSET to indicate a bad host virtual address. As this check won't work on architectures that don't map kernel and user memory into the same address space (e.g. s390), it is moved into architcture specific code. Signed-off-by: Dominik Dingel --- arch/a

[RFC PATCH v2 0/4] Enable async page faults on s390

2013-07-05 Thread Dominik Dingel
ce hase to enable the capability. With that knob we can later on disable this feature for live migration. v1 -> v2: - Adding other architecture backends - Adding documentation for the ioctl - Improving the overall error handling - Reducing the needed modifications on the common code Domi

[PATCH 4/4] PF: Async page fault support on s390

2013-07-05 Thread Dominik Dingel
guest interface for this purpose, as described in "CP Programming Services" (SC24-6084)". Signed-off-by: Dominik Dingel --- Documentation/s390/kvm.txt | 24 ++ arch/s390/include/asm/kvm_host.h | 22 + arch/s390/include/uapi/asm/kvm.h | 10 arch/s

[PATCH 1/4] PF: Add FAULT_FLAG_RETRY_NOWAIT for guest fault

2013-07-05 Thread Dominik Dingel
In case of a fault retry exit sie64() with gmap_fault indication for the running thread set. This makes it possible to handle async page faults without the need for mm notifiers. Based on a patch from Martin Schwidefsky. Signed-off-by: Dominik Dingel --- arch/s390/include/asm/pgtable.h | 2

[PATCH 3/4] PF: Provide additional direct page notification

2013-07-05 Thread Dominik Dingel
will directly push the information to the guest. Still the vcpu thread should call check_completion to cleanup leftovers, that leaves most of the common code untouched. Signed-off-by: Dominik Dingel --- arch/x86/kvm/mmu.c | 2 +- include/linux/kvm_host.h | 2 +- virt/kvm/Kconfig

[PATCH 4/4] PF: Async page fault support on s390

2013-07-09 Thread Dominik Dingel
this purpose, as described in "CP Programming Services (SC24-6084)". Signed-off-by: Dominik Dingel --- Documentation/s390/kvm.txt | 24 ++ arch/s390/include/asm/kvm_host.h | 22 + arch/s390/include/uapi/asm/kvm.h | 10 arch/s390/kvm/Kconfig|

[PATCH 2/4] PF: Make KVM_HVA_ERR_BAD usable on s390

2013-07-09 Thread Dominik Dingel
ned-off-by: Dominik Dingel --- include/linux/kvm_host.h | 14 ++ 1 file changed, 14 insertions(+) diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index a63d83e..f3c04e7 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h @@ -85,6 +85,18 @@ static i

[PATCH v3 0/4] Enable async page faults on s390

2013-07-09 Thread Dominik Dingel
handling v1 -> v2: - Adding other architecture backends - Adding documentation for the ioctl - Improving the overall error handling - Reducing the needed modifications on the common code Dominik Dingel (4): PF: Add FAULT_FLAG_RETRY_NOWAIT for guest fault PF: Make KVM_HVA_ERR_BAD usa

[PATCH 3/4] PF: Provide additional direct page notification

2013-07-09 Thread Dominik Dingel
will directly push the information to the guest. Still the vcpu thread should call check_completion to cleanup leftovers, that leaves most of the common code untouched. Signed-off-by: Dominik Dingel --- arch/x86/kvm/mmu.c | 2 +- include/linux/kvm_host.h | 2 +- virt/kvm/Kconfig

[PATCH 1/4] PF: Add FAULT_FLAG_RETRY_NOWAIT for guest fault

2013-07-09 Thread Dominik Dingel
In case of a fault retry exit sie64() with gmap_fault indication for the running thread set. This makes it possible to handle async page faults without the need for mm notifiers. Based on a patch from Martin Schwidefsky. Signed-off-by: Dominik Dingel --- arch/s390/include/asm/pgtable.h | 2

[PATCH 2/4] PF: Make KVM_HVA_ERR_BAD usable on s390

2013-07-10 Thread Dominik Dingel
Current common code uses PAGE_OFFSET to indicate a bad host virtual address. As this check won't work on architectures that don't map kernel and user memory into the same address space (e.g. s390), such architectures can now provide there own KVM_HVA_ERR_BAD defines. Signed-off-by: Domi

[PATCH 1/4] PF: Add FAULT_FLAG_RETRY_NOWAIT for guest fault

2013-07-10 Thread Dominik Dingel
In case of a fault retry exit sie64() with gmap_fault indication for the running thread set. This makes it possible to handle async page faults without the need for mm notifiers. Based on a patch from Martin Schwidefsky. Signed-off-by: Dominik Dingel Acked-by: Christian Borntraeger --- arch

[PATCH v4 0/4] Enable async page faults on s390

2013-07-10 Thread Dominik Dingel
ll error handling - Reducing the needed modifications on the common code Dominik Dingel (4): PF: Add FAULT_FLAG_RETRY_NOWAIT for guest fault PF: Make KVM_HVA_ERR_BAD usable on s390 PF: Provide additional direct page notification PF: Async page fault support on s390 Documentat

[PATCH 4/4] PF: Async page fault support on s390

2013-07-10 Thread Dominik Dingel
this purpose, as described in "CP Programming Services (SC24-6084)". Signed-off-by: Dominik Dingel --- Documentation/s390/kvm.txt | 24 + arch/s390/include/asm/kvm_host.h | 22 arch/s390/include/uapi/asm/kvm.h | 10 arch/s390/kvm/Kconfig|

[PATCH 3/4] PF: Provide additional direct page notification

2013-07-10 Thread Dominik Dingel
will directly push the information to the guest. This way s390 can use an already existing architecture interface. Still the vcpu thread should call check_completion to cleanup leftovers, that leaves most of the common code untouched. Signed-off-by: Dominik Dingel Acked-by: Christian Borntraeger

[PATCH 1/4] s390/mm: recfactor global pgste updates

2014-10-17 Thread Dominik Dingel
Replace the s390 specific page table walker for the pgste updates with a call to the common code walk_page_range function. There are now two pte modification functions, one for the reset of the CMMA state and another one for the initialization of the storage keys. Signed-off-by: Dominik Dingel

[PATCH 2/4] mm: introduce new VM_NOZEROPAGE flag

2014-10-17 Thread Dominik Dingel
Add a new vma flag to allow an architecture to disable the backing of non-present, anonymous pages with the read-only empty zero page. Signed-off-by: Dominik Dingel Acked-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky --- include/linux/mm.h | 13 +++-- mm/huge_memory.c

[PATCH 0/4] mm: new flag to forbid zero page mappings for a vma

2014-10-17 Thread Dominik Dingel
guest memory. Dominik Dingel (4): s390/mm: recfactor global pgste updates mm: introduce new VM_NOZEROPAGE flag s390/mm: prevent and break zero page mappings in case of storage keys s390/mm: disable KSM for storage key enabled pages arch/s390/Kconfig | 3 + arch/s390/includ

[PATCH 3/4] s390/mm: prevent and break zero page mappings in case of storage keys

2014-10-17 Thread Dominik Dingel
n need to retry the fixup_user_fault. Signed-off-by: Dominik Dingel Acked-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky --- arch/s390/Kconfig | 3 +++ arch/s390/mm/pgtable.c | 15 +++ 2 files changed, 18 insertions(+) diff --git a/arch/s390/Kconfig b/arch/s39

[PATCH 4/4] s390/mm: disable KSM for storage key enabled pages

2014-10-17 Thread Dominik Dingel
When storage keys are enabled unmerge already merged pages and prevent new pages from being merged. Signed-off-by: Dominik Dingel Acked-by: Christian Borntraeger Signed-off-by: Martin Schwidefsky --- arch/s390/include/asm/pgtable.h | 2 +- arch/s390/kvm/priv.c| 17

Re: [PATCH 2/4] mm: introduce new VM_NOZEROPAGE flag

2014-10-18 Thread Dominik Dingel
On Fri, 17 Oct 2014 15:04:21 -0700 Dave Hansen wrote: > Is there ever a time where the VMAs under an mm have mixed VM_NOZEROPAGE > status? Reading the patches, it _looks_ like it might be an all or > nothing thing. Currently it is an all or nothing thing, but for a future change we might want

Re: [PATCH 2/4] mm: introduce new VM_NOZEROPAGE flag

2014-10-21 Thread Dominik Dingel
On Tue, 21 Oct 2014 10:11:43 +0200 Paolo Bonzini wrote: > > > On 10/21/2014 08:11 AM, Martin Schwidefsky wrote: > >> I agree with Dave (I thought I disagreed, but I changed my mind while > >> writing down my thoughts). Just define mm_forbids_zeropage in > >> arch/s390/include/asm, and make it

[PATCH 1/4] s390/mm: recfactor global pgste updates

2014-10-22 Thread Dominik Dingel
Replace the s390 specific page table walker for the pgste updates with a call to the common code walk_page_range function. There are now two pte modification functions, one for the reset of the CMMA state and another one for the initialization of the storage keys. Signed-off-by: Dominik Dingel

[PATCH v2 0/4] mm: new function to forbid zeropage mappings for a process

2014-10-22 Thread Dominik Dingel
guest memory. v1 -> v2: - Following Dave and Paolo suggestion removing the vma flag Dominik Dingel (4): s390/mm: recfactor global pgste updates mm: introduce mm_forbids_zeropage function s390/mm: prevent and break zero page mappings in case of storage keys s390/mm: disable KSM for sto

[PATCH 4/4] s390/mm: disable KSM for storage key enabled pages

2014-10-22 Thread Dominik Dingel
When storage keys are enabled unmerge already merged pages and prevent new pages from being merged. Signed-off-by: Dominik Dingel Acked-by: Christian Borntraeger --- arch/s390/include/asm/pgtable.h | 2 +- arch/s390/kvm/priv.c| 17 - arch/s390/mm/pgtable.c

[PATCH 3/4] s390/mm: prevent and break zero page mappings in case of storage keys

2014-10-22 Thread Dominik Dingel
and host large pages are also mutual exclusive we do not even need to retry the fixup_user_fault. As use_skey is already the condition on which we call s390_enable_skey we need to introduce a new flag for the mm->context on which we decide if zero page mapping is allowed. Signed-off-by: Do

[PATCH 2/4] mm: introduce mm_forbids_zeropage function

2014-10-22 Thread Dominik Dingel
Add a new function stub to allow architectures to disable for an mm_structthe backing of non-present, anonymous pages with read-only empty zero pages. Signed-off-by: Dominik Dingel --- include/linux/mm.h | 4 mm/huge_memory.c | 2 +- mm/memory.c| 2 +- 3 files changed, 6

Re: [PATCH 3/4] s390/mm: prevent and break zero page mappings in case of storage keys

2014-10-22 Thread Dominik Dingel
On Wed, 22 Oct 2014 12:09:31 +0200 Paolo Bonzini wrote: > On 10/22/2014 10:30 AM, Dominik Dingel wrote: > > As use_skey is already the condition on which we call s390_enable_skey > > we need to introduce a new flag for the mm->context on which we decide > > if zero

[PATCH 2/4] mm: introduce mm_forbids_zeropage function

2014-10-22 Thread Dominik Dingel
Add a new function stub to allow architectures to disable for an mm_structthe backing of non-present, anonymous pages with read-only empty zero pages. Signed-off-by: Dominik Dingel --- include/linux/mm.h | 4 mm/huge_memory.c | 2 +- mm/memory.c| 2 +- 3 files changed, 6

[PATCH 4/4] s390/mm: disable KSM for storage key enabled pages

2014-10-22 Thread Dominik Dingel
When storage keys are enabled unmerge already merged pages and prevent new pages from being merged. Signed-off-by: Dominik Dingel Acked-by: Christian Borntraeger --- arch/s390/include/asm/pgtable.h | 2 +- arch/s390/kvm/priv.c| 17 - arch/s390/mm/pgtable.c

[PATCH 1/4] s390/mm: recfactor global pgste updates

2014-10-22 Thread Dominik Dingel
Replace the s390 specific page table walker for the pgste updates with a call to the common code walk_page_range function. There are now two pte modification functions, one for the reset of the CMMA state and another one for the initialization of the storage keys. Signed-off-by: Dominik Dingel

[PATCH 3/4] s390/mm: prevent and break zero page mappings in case of storage keys

2014-10-22 Thread Dominik Dingel
her vCPUs executing storage key instructions will get a one time interception and be serialized also with mmap_sem. Signed-off-by: Dominik Dingel --- arch/s390/include/asm/pgtable.h | 5 + arch/s390/mm/pgtable.c | 13 - 2 files changed, 17 insertions(+), 1 deletion(-) diff --g

[PATCH v3 0/4] mm: new function to forbid zeropage mappings for a process

2014-10-22 Thread Dominik Dingel
guest memory. v2 -> v3: - Clearing up patch description Patch 3/4 - removing unnecessary flag in mmu_context (Paolo) v1 -> v2: - Following Dave and Paolo suggestion removing the vma flag Dominik Dingel (4): s390/mm: recfactor global pgste updates mm: introduce mm_forbids_zeropa

Re: [PATCH 2/4] mm: introduce mm_forbids_zeropage function

2014-10-22 Thread Dominik Dingel
On Wed, 22 Oct 2014 12:22:23 -0700 Andrew Morton wrote: > On Wed, 22 Oct 2014 13:09:28 +0200 Dominik Dingel > wrote: > > > Add a new function stub to allow architectures to disable for > > an mm_structthe backing of non-present, anonymous pages with > >

[PATCH] KVM: trivial fix comment regarding __kvm_set_memory_region

2014-10-27 Thread Dominik Dingel
commit 72dc67a69690 ("KVM: remove the usage of the mmap_sem for the protection of the memory slots.") changed the lock which will be taken. This should be reflected in the function commentary. Signed-off-by: Dominik Dingel --- virt/kvm/kvm_main.c | 2 +- 1 file changed, 1 inser

[PATCH] kvm: fix preemption warnings in kvm_vcpu_block

2015-09-17 Thread Dominik Dingel
Commit f78195129963 ("kvm: add halt_poll_ns module parameter") calls, with enabled preemption, single_task_running. When CONFIG_DEBUG_PREEMPT is enabled that will result in a debug_smp_processor_id() call. Cc: # 4.2.x Signed-off-by: Dominik Dingel --- virt/kvm/kvm_main.c | 8 ++

Re: single_task_running() vs. preemption warnings (was Re: [PATCH] kvm: fix preemption warnings in kvm_vcpu_block)

2015-09-17 Thread Dominik Dingel
On Thu, 17 Sep 2015 18:45:00 +0200 Paolo Bonzini wrote: > > > On 17/09/2015 18:27, Dominik Dingel wrote: > > + preempt_disable(); > > + solo = single_task_running(); > > + preempt_enable(); > > + > &

[PATCH] sched: access local runqueue directly in single_task_running

2015-09-18 Thread Dominik Dingel
t the usefulness, we change single_task_running to access directly the cpu local runqueue. Cc: Tim Chen Suggested-by: Peter Zijlstra Cc: # 4.2.x Signed-off-by: Dominik Dingel --- kernel/sched/core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/sched/core.c b

Re: [PATCH] sched: access local runqueue directly in single_task_running

2015-09-18 Thread Dominik Dingel
On Fri, 18 Sep 2015 13:26:53 +0200 Paolo Bonzini wrote: > > > On 18/09/2015 11:27, Dominik Dingel wrote: > > Commit 2ee507c47293 ("sched: Add function single_task_running to let a task > > check if it is the only task running on a cpu") referenced th