aboutsummaryrefslogtreecommitdiffstats
path: root/arch/s390/kvm/intercept.c
diff options
context:
space:
mode:
authorCarsten Otte <cotte@de.ibm.com>2011-07-24 04:48:21 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2011-07-24 04:48:21 -0400
commit598841ca9919d008b520114d8a4378c4ce4e40a1 (patch)
tree3f823474e70af4305c395fb220a138b5bc4e9f90 /arch/s390/kvm/intercept.c
parente5992f2e6c3829cd43dbc4438ee13dcd6506f7f3 (diff)
[S390] use gmap address spaces for kvm guest images
This patch switches kvm from using (Qemu's) user address space to Martin's gmap address space. This way QEMU does not have to use a linker script in order to fit large guests at low addresses in its address space. Signed-off-by: Carsten Otte <cotte@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/kvm/intercept.c')
-rw-r--r--arch/s390/kvm/intercept.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/arch/s390/kvm/intercept.c b/arch/s390/kvm/intercept.c
index b5312050b224..654fc1fa37e7 100644
--- a/arch/s390/kvm/intercept.c
+++ b/arch/s390/kvm/intercept.c
@@ -160,6 +160,7 @@ static int handle_stop(struct kvm_vcpu *vcpu)
160 160
161static int handle_validity(struct kvm_vcpu *vcpu) 161static int handle_validity(struct kvm_vcpu *vcpu)
162{ 162{
163 unsigned long vmaddr;
163 int viwhy = vcpu->arch.sie_block->ipb >> 16; 164 int viwhy = vcpu->arch.sie_block->ipb >> 16;
164 int rc; 165 int rc;
165 166
@@ -170,12 +171,27 @@ static int handle_validity(struct kvm_vcpu *vcpu)
170 vcpu->arch.sie_block->gmsor + 171 vcpu->arch.sie_block->gmsor +
171 vcpu->arch.sie_block->prefix, 172 vcpu->arch.sie_block->prefix,
172 2*PAGE_SIZE); 173 2*PAGE_SIZE);
173 if (rc) 174 if (rc) {
174 /* user will receive sigsegv, exit to user */ 175 /* user will receive sigsegv, exit to user */
175 rc = -EOPNOTSUPP; 176 rc = -EOPNOTSUPP;
177 goto out;
178 }
179 vmaddr = gmap_fault(vcpu->arch.sie_block->prefix,
180 vcpu->arch.gmap);
181 if (IS_ERR_VALUE(vmaddr)) {
182 rc = -EOPNOTSUPP;
183 goto out;
184 }
185 vmaddr = gmap_fault(vcpu->arch.sie_block->prefix + PAGE_SIZE,
186 vcpu->arch.gmap);
187 if (IS_ERR_VALUE(vmaddr)) {
188 rc = -EOPNOTSUPP;
189 goto out;
190 }
176 } else 191 } else
177 rc = -EOPNOTSUPP; 192 rc = -EOPNOTSUPP;
178 193
194out:
179 if (rc) 195 if (rc)
180 VCPU_EVENT(vcpu, 2, "unhandled validity intercept code %d", 196 VCPU_EVENT(vcpu, 2, "unhandled validity intercept code %d",
181 viwhy); 197 viwhy);