Skip to content

Commit

Permalink
Merge tag 'kvm-s390-next-5.7-3' of git://git.kernel.org/pub/scm/linux…
Browse files Browse the repository at this point in the history
…/kernel/git/kvms390/linux into HEAD

KVM: s390: Fix for error codes

- return the proper error to userspace when a signal interrupts the
  KSM unsharing operation
  • Loading branch information
bonzini committed Mar 30, 2020
2 parents 8bf8961 + 7a26536 commit 830948e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
6 changes: 6 additions & 0 deletions Documentation/virt/kvm/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4666,6 +4666,12 @@ KVM_PV_ENABLE
command has succeeded, any CPU added via hotplug will become
protected during its creation as well.

Errors:

===== =============================
EINTR an unmasked signal is pending
===== =============================

KVM_PV_DISABLE

Deregister the VM from the Ultravisor and reclaim the memory that
Expand Down
9 changes: 5 additions & 4 deletions arch/s390/mm/gmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2552,12 +2552,13 @@ int gmap_mark_unmergeable(void)
{
struct mm_struct *mm = current->mm;
struct vm_area_struct *vma;
int ret;

for (vma = mm->mmap; vma; vma = vma->vm_next) {
if (ksm_madvise(vma, vma->vm_start, vma->vm_end,
MADV_UNMERGEABLE, &vma->vm_flags)) {
return -ENOMEM;
}
ret = ksm_madvise(vma, vma->vm_start, vma->vm_end,
MADV_UNMERGEABLE, &vma->vm_flags);
if (ret)
return ret;
}
mm->def_flags &= ~VM_MERGEABLE;
return 0;
Expand Down

0 comments on commit 830948e

Please sign in to comment.