Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372975
b: refs/heads/master
c: 59a1fa2
h: refs/heads/master
i:
  372973: 6dbd96a
  372971: 8c42b78
  372967: 4a87f4d
  372959: ee5f6af
v: v3
  • Loading branch information
Heiko Carstens authored and Marcelo Tosatti committed Mar 7, 2013
1 parent de14d26 commit c46be80
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9e0fdb4145205bea95c2888a195c3ead2652f120
refs/heads/master: 59a1fa2d80c0d351755cb29273b2b256dc4b3a11
21 changes: 9 additions & 12 deletions trunk/arch/s390/kvm/priv.c
Original file line number Diff line number Diff line change
Expand Up @@ -575,20 +575,13 @@ static int handle_tprot(struct kvm_vcpu *vcpu)
if (vcpu->arch.sie_block->gpsw.mask & PSW_MASK_DAT)
return -EOPNOTSUPP;


/* we must resolve the address without holding the mmap semaphore.
* This is ok since the userspace hypervisor is not supposed to change
* the mapping while the guest queries the memory. Otherwise the guest
* might crash or get wrong info anyway. */
user_address = (unsigned long) __guestaddr_to_user(vcpu, address1);

down_read(&current->mm->mmap_sem);
user_address = __gmap_translate(address1, vcpu->arch.gmap);
if (IS_ERR_VALUE(user_address))
goto out_inject;
vma = find_vma(current->mm, user_address);
if (!vma) {
up_read(&current->mm->mmap_sem);
return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
}

if (!vma)
goto out_inject;
vcpu->arch.sie_block->gpsw.mask &= ~(3ul << 44);
if (!(vma->vm_flags & VM_WRITE) && (vma->vm_flags & VM_READ))
vcpu->arch.sie_block->gpsw.mask |= (1ul << 44);
Expand All @@ -597,6 +590,10 @@ static int handle_tprot(struct kvm_vcpu *vcpu)

up_read(&current->mm->mmap_sem);
return 0;

out_inject:
up_read(&current->mm->mmap_sem);
return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
}

int kvm_s390_handle_e5(struct kvm_vcpu *vcpu)
Expand Down

0 comments on commit c46be80

Please sign in to comment.