Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 275646
b: refs/heads/master
c: 1eddb85
h: refs/heads/master
v: v3
  • Loading branch information
Christian Borntraeger authored and Avi Kivity committed Nov 17, 2011
1 parent 72289e5 commit 997adc0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 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: bd59d3a4444e5f941c863db1a7715edf7289e29a
refs/heads/master: 1eddb85f889a5a9fe59ec184e06844716a00aded
10 changes: 8 additions & 2 deletions trunk/arch/s390/kvm/priv.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,7 @@ static int handle_tprot(struct kvm_vcpu *vcpu)
u64 address1 = disp1 + base1 ? vcpu->arch.guest_gprs[base1] : 0;
u64 address2 = disp2 + base2 ? vcpu->arch.guest_gprs[base2] : 0;
struct vm_area_struct *vma;
unsigned long user_address;

vcpu->stat.instruction_tprot++;

Expand All @@ -349,9 +350,14 @@ static int handle_tprot(struct kvm_vcpu *vcpu)
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);
vma = find_vma(current->mm,
(unsigned long) __guestaddr_to_user(vcpu, address1));
vma = find_vma(current->mm, user_address);
if (!vma) {
up_read(&current->mm->mmap_sem);
return kvm_s390_inject_program_int(vcpu, PGM_ADDRESSING);
Expand Down

0 comments on commit 997adc0

Please sign in to comment.