aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/sigp.c
diff options
context:
space:
mode:
authorCarsten Otte <cotte@de.ibm.com>2011-07-24 04:48:22 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2011-07-24 04:48:21 -0400
commit092670cd90eb88c33661de21f1b4ee08d2597171 (patch)
tree2960d3ef459eccd0c2a7d0e2a77fad9bdb2437f2 /arch/s390/kvm/sigp.c
parent598841ca9919d008b520114d8a4378c4ce4e40a1 (diff)
[S390] Use gmap translation for accessing guest memory
This patch removes kvm-s390 internal assumption of a linear mapping of guest address space to user space. Previously, guest memory was translated to user addresses using a fixed offset (gmsor). The new code uses gmap_fault to resolve guest addresses. Signed-off-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/sigp.c')
-rw-r--r--arch/s390/kvm/sigp.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/s390/kvm/sigp.c b/arch/s390/kvm/sigp.c
index 702276f5e2fa..d6a50c1fb2e6 100644
--- a/arch/s390/kvm/sigp.c
+++ b/arch/s390/kvm/sigp.c
@@ -189,10 +189,8 @@ static int __sigp_set_prefix(struct kvm_vcpu *vcpu, u16 cpu_addr, u32 address,
189 189
190 /* make sure that the new value is valid memory */ 190 /* make sure that the new value is valid memory */
191 address = address & 0x7fffe000u; 191 address = address & 0x7fffe000u;
192 if ((copy_from_user(&tmp, (void __user *) 192 if (copy_from_guest_absolute(vcpu, &tmp, address, 1) ||
193 (address + vcpu->arch.sie_block->gmsor) , 1)) || 193 copy_from_guest_absolute(vcpu, &tmp, address + PAGE_SIZE, 1)) {
194 (copy_from_user(&tmp, (void __user *)(address +
195 vcpu->arch.sie_block->gmsor + PAGE_SIZE), 1))) {
196 *reg |= SIGP_STAT_INVALID_PARAMETER; 194 *reg |= SIGP_STAT_INVALID_PARAMETER;
197 return 1; /* invalid parameter */ 195 return 1; /* invalid parameter */
198 } 196 }