diff options
Diffstat (limited to 'arch/s390/kvm/gaccess.h')
-rw-r--r-- | arch/s390/kvm/gaccess.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/arch/s390/kvm/gaccess.h b/arch/s390/kvm/gaccess.h index 4703f129e95e..84d01dd7a8e4 100644 --- a/arch/s390/kvm/gaccess.h +++ b/arch/s390/kvm/gaccess.h | |||
@@ -22,13 +22,16 @@ static inline void __user *__guestaddr_to_user(struct kvm_vcpu *vcpu, | |||
22 | unsigned long guestaddr) | 22 | unsigned long guestaddr) |
23 | { | 23 | { |
24 | unsigned long prefix = vcpu->arch.sie_block->prefix; | 24 | unsigned long prefix = vcpu->arch.sie_block->prefix; |
25 | unsigned long uaddress; | ||
25 | 26 | ||
26 | if (guestaddr < 2 * PAGE_SIZE) | 27 | if (guestaddr < 2 * PAGE_SIZE) |
27 | guestaddr += prefix; | 28 | guestaddr += prefix; |
28 | else if ((guestaddr >= prefix) && (guestaddr < prefix + 2 * PAGE_SIZE)) | 29 | else if ((guestaddr >= prefix) && (guestaddr < prefix + 2 * PAGE_SIZE)) |
29 | guestaddr -= prefix; | 30 | guestaddr -= prefix; |
30 | 31 | uaddress = gmap_fault(guestaddr, vcpu->arch.gmap); | |
31 | return (void __user *) gmap_fault(guestaddr, vcpu->arch.gmap); | 32 | if (IS_ERR_VALUE(uaddress)) |
33 | uaddress = -EFAULT; | ||
34 | return (void __user *)uaddress; | ||
32 | } | 35 | } |
33 | 36 | ||
34 | static inline int get_guest_u64(struct kvm_vcpu *vcpu, unsigned long guestaddr, | 37 | static inline int get_guest_u64(struct kvm_vcpu *vcpu, unsigned long guestaddr, |