summaryrefslogtreecommitdiff
path: root/arch/s390/kvm/gaccess.h
diff options
context:
space:
mode:
authorHeiko Carstens <heiko.carstens@de.ibm.com>2013-03-05 13:14:47 +0100
committerMarcelo Tosatti <mtosatti@redhat.com>2013-03-07 16:21:22 -0300
commit0a75ca277c9f1145df37f8bbad10aecf0049a554 (patch)
treed5831ac8ff4eaeb9250398d3e2ca9a591669801f /arch/s390/kvm/gaccess.h
parent7c959e82ac331396d05e7118a48c7c1debbefdf8 (diff)
s390/kvm,gaccess: add address space annotations
Add missing address space annotations to all put_guest()/get_guest() callers. Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> Acked-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com> Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/s390/kvm/gaccess.h')
-rw-r--r--arch/s390/kvm/gaccess.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/s390/kvm/gaccess.h b/arch/s390/kvm/gaccess.h
index 8608d7e6a334..302e0e52b009 100644
--- a/arch/s390/kvm/gaccess.h
+++ b/arch/s390/kvm/gaccess.h
@@ -18,8 +18,9 @@
#include <asm/uaccess.h>
#include "kvm-s390.h"
-static inline void *__gptr_to_uptr(struct kvm_vcpu *vcpu, void *gptr,
- int prefixing)
+static inline void __user *__gptr_to_uptr(struct kvm_vcpu *vcpu,
+ void __user *gptr,
+ int prefixing)
{
unsigned long prefix = vcpu->arch.sie_block->prefix;
unsigned long gaddr = (unsigned long) gptr;
@@ -34,14 +35,14 @@ static inline void *__gptr_to_uptr(struct kvm_vcpu *vcpu, void *gptr,
uaddr = gmap_fault(gaddr, vcpu->arch.gmap);
if (IS_ERR_VALUE(uaddr))
uaddr = -EFAULT;
- return (void *)uaddr;
+ return (void __user *)uaddr;
}
#define get_guest(vcpu, x, gptr) \
({ \
__typeof__(gptr) __uptr = __gptr_to_uptr(vcpu, gptr, 1);\
int __mask = sizeof(__typeof__(*(gptr))) - 1; \
- int __ret = PTR_RET(__uptr); \
+ int __ret = PTR_RET((void __force *)__uptr); \
\
if (!__ret) { \
BUG_ON((unsigned long)__uptr & __mask); \
@@ -54,7 +55,7 @@ static inline void *__gptr_to_uptr(struct kvm_vcpu *vcpu, void *gptr,
({ \
__typeof__(gptr) __uptr = __gptr_to_uptr(vcpu, gptr, 1);\
int __mask = sizeof(__typeof__(*(gptr))) - 1; \
- int __ret = PTR_RET(__uptr); \
+ int __ret = PTR_RET((void __force *)__uptr); \
\
if (!__ret) { \
BUG_ON((unsigned long)__uptr & __mask); \
@@ -68,19 +69,19 @@ static inline int __copy_guest(struct kvm_vcpu *vcpu, unsigned long to,
int to_guest, int prefixing)
{
unsigned long _len, rc;
- void *uptr;
+ void __user *uptr;
while (len) {
- uptr = to_guest ? (void *)to : (void *)from;
+ uptr = to_guest ? (void __user *)to : (void __user *)from;
uptr = __gptr_to_uptr(vcpu, uptr, prefixing);
- if (IS_ERR(uptr))
+ if (IS_ERR((void __force *)uptr))
return -EFAULT;
_len = PAGE_SIZE - ((unsigned long)uptr & (PAGE_SIZE - 1));
_len = min(_len, len);
if (to_guest)
- rc = copy_to_user(uptr, (void *)from, _len);
+ rc = copy_to_user((void __user *) uptr, (void *)from, _len);
else
- rc = copy_from_user((void *)to, uptr, _len);
+ rc = copy_from_user((void *)to, (void __user *)uptr, _len);
if (rc)
return -EFAULT;
len -= _len;