• Home
  • Raw
  • Download

Lines Matching refs:arch

200 	kvm->arch.sca = (struct sca_block *) get_zeroed_page(GFP_KERNEL);  in kvm_arch_init_vm()
201 if (!kvm->arch.sca) in kvm_arch_init_vm()
206 kvm->arch.dbf = debug_register(debug_name, 8, 2, 8 * sizeof(long)); in kvm_arch_init_vm()
207 if (!kvm->arch.dbf) in kvm_arch_init_vm()
210 spin_lock_init(&kvm->arch.float_int.lock); in kvm_arch_init_vm()
211 INIT_LIST_HEAD(&kvm->arch.float_int.list); in kvm_arch_init_vm()
213 debug_register_view(kvm->arch.dbf, &debug_sprintf_view); in kvm_arch_init_vm()
217 kvm->arch.gmap = NULL; in kvm_arch_init_vm()
219 kvm->arch.gmap = gmap_alloc(current->mm); in kvm_arch_init_vm()
220 if (!kvm->arch.gmap) in kvm_arch_init_vm()
225 debug_unregister(kvm->arch.dbf); in kvm_arch_init_vm()
227 free_page((unsigned long)(kvm->arch.sca)); in kvm_arch_init_vm()
237 (unsigned long *) &vcpu->kvm->arch.sca->mcn); in kvm_arch_vcpu_destroy()
238 if (vcpu->kvm->arch.sca->cpu[vcpu->vcpu_id].sda == in kvm_arch_vcpu_destroy()
239 (__u64) vcpu->arch.sie_block) in kvm_arch_vcpu_destroy()
240 vcpu->kvm->arch.sca->cpu[vcpu->vcpu_id].sda = 0; in kvm_arch_vcpu_destroy()
245 gmap_free(vcpu->arch.gmap); in kvm_arch_vcpu_destroy()
247 free_page((unsigned long)(vcpu->arch.sie_block)); in kvm_arch_vcpu_destroy()
275 free_page((unsigned long)(kvm->arch.sca)); in kvm_arch_destroy_vm()
276 debug_unregister(kvm->arch.dbf); in kvm_arch_destroy_vm()
278 gmap_free(kvm->arch.gmap); in kvm_arch_destroy_vm()
285 vcpu->arch.gmap = gmap_alloc(current->mm); in kvm_arch_vcpu_init()
286 if (!vcpu->arch.gmap) in kvm_arch_vcpu_init()
291 vcpu->arch.gmap = vcpu->kvm->arch.gmap; in kvm_arch_vcpu_init()
306 save_fp_regs(&vcpu->arch.host_fpregs); in kvm_arch_vcpu_load()
307 save_access_regs(vcpu->arch.host_acrs); in kvm_arch_vcpu_load()
308 vcpu->arch.guest_fpregs.fpc &= FPC_VALID_MASK; in kvm_arch_vcpu_load()
309 restore_fp_regs(&vcpu->arch.guest_fpregs); in kvm_arch_vcpu_load()
311 gmap_enable(vcpu->arch.gmap); in kvm_arch_vcpu_load()
312 atomic_set_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags); in kvm_arch_vcpu_load()
317 atomic_clear_mask(CPUSTAT_RUNNING, &vcpu->arch.sie_block->cpuflags); in kvm_arch_vcpu_put()
318 gmap_disable(vcpu->arch.gmap); in kvm_arch_vcpu_put()
319 save_fp_regs(&vcpu->arch.guest_fpregs); in kvm_arch_vcpu_put()
321 restore_fp_regs(&vcpu->arch.host_fpregs); in kvm_arch_vcpu_put()
322 restore_access_regs(vcpu->arch.host_acrs); in kvm_arch_vcpu_put()
328 vcpu->arch.sie_block->gpsw.mask = 0UL; in kvm_s390_vcpu_initial_reset()
329 vcpu->arch.sie_block->gpsw.addr = 0UL; in kvm_s390_vcpu_initial_reset()
331 vcpu->arch.sie_block->cputm = 0UL; in kvm_s390_vcpu_initial_reset()
332 vcpu->arch.sie_block->ckc = 0UL; in kvm_s390_vcpu_initial_reset()
333 vcpu->arch.sie_block->todpr = 0; in kvm_s390_vcpu_initial_reset()
334 memset(vcpu->arch.sie_block->gcr, 0, 16 * sizeof(__u64)); in kvm_s390_vcpu_initial_reset()
335 vcpu->arch.sie_block->gcr[0] = 0xE0UL; in kvm_s390_vcpu_initial_reset()
336 vcpu->arch.sie_block->gcr[14] = 0xC2000000UL; in kvm_s390_vcpu_initial_reset()
337 vcpu->arch.guest_fpregs.fpc = 0; in kvm_s390_vcpu_initial_reset()
338 asm volatile("lfpc %0" : : "Q" (vcpu->arch.guest_fpregs.fpc)); in kvm_s390_vcpu_initial_reset()
339 vcpu->arch.sie_block->gbea = 1; in kvm_s390_vcpu_initial_reset()
344 atomic_set(&vcpu->arch.sie_block->cpuflags, CPUSTAT_ZARCH | in kvm_arch_vcpu_setup()
347 vcpu->arch.sie_block->ecb = 6; in kvm_arch_vcpu_setup()
348 vcpu->arch.sie_block->eca = 0xC1002001U; in kvm_arch_vcpu_setup()
349 vcpu->arch.sie_block->fac = (int) (long) facilities; in kvm_arch_vcpu_setup()
350 hrtimer_init(&vcpu->arch.ckc_timer, CLOCK_REALTIME, HRTIMER_MODE_ABS); in kvm_arch_vcpu_setup()
351 tasklet_init(&vcpu->arch.tasklet, kvm_s390_tasklet, in kvm_arch_vcpu_setup()
353 vcpu->arch.ckc_timer.function = kvm_s390_idle_wakeup; in kvm_arch_vcpu_setup()
354 get_cpu_id(&vcpu->arch.cpu_id); in kvm_arch_vcpu_setup()
355 vcpu->arch.cpu_id.version = 0xff; in kvm_arch_vcpu_setup()
374 vcpu->arch.sie_block = (struct kvm_s390_sie_block *) in kvm_arch_vcpu_create()
377 if (!vcpu->arch.sie_block) in kvm_arch_vcpu_create()
380 vcpu->arch.sie_block->icpua = id; in kvm_arch_vcpu_create()
382 if (!kvm->arch.sca) { in kvm_arch_vcpu_create()
386 if (!kvm->arch.sca->cpu[id].sda) in kvm_arch_vcpu_create()
387 kvm->arch.sca->cpu[id].sda = in kvm_arch_vcpu_create()
388 (__u64) vcpu->arch.sie_block; in kvm_arch_vcpu_create()
389 vcpu->arch.sie_block->scaoh = in kvm_arch_vcpu_create()
390 (__u32)(((__u64)kvm->arch.sca) >> 32); in kvm_arch_vcpu_create()
391 vcpu->arch.sie_block->scaol = (__u32)(__u64)kvm->arch.sca; in kvm_arch_vcpu_create()
392 set_bit(63 - id, (unsigned long *) &kvm->arch.sca->mcn); in kvm_arch_vcpu_create()
395 spin_lock_init(&vcpu->arch.local_int.lock); in kvm_arch_vcpu_create()
396 INIT_LIST_HEAD(&vcpu->arch.local_int.list); in kvm_arch_vcpu_create()
397 vcpu->arch.local_int.float_int = &kvm->arch.float_int; in kvm_arch_vcpu_create()
398 spin_lock(&kvm->arch.float_int.lock); in kvm_arch_vcpu_create()
399 kvm->arch.float_int.local_int[id] = &vcpu->arch.local_int; in kvm_arch_vcpu_create()
400 init_waitqueue_head(&vcpu->arch.local_int.wq); in kvm_arch_vcpu_create()
401 vcpu->arch.local_int.cpuflags = &vcpu->arch.sie_block->cpuflags; in kvm_arch_vcpu_create()
402 spin_unlock(&kvm->arch.float_int.lock); in kvm_arch_vcpu_create()
408 vcpu->arch.sie_block); in kvm_arch_vcpu_create()
412 free_page((unsigned long)(vcpu->arch.sie_block)); in kvm_arch_vcpu_create()
448 memcpy(&vcpu->arch.sie_block->gcr, &sregs->crs, sizeof(sregs->crs)); in kvm_arch_vcpu_ioctl_set_sregs()
457 memcpy(&sregs->crs, &vcpu->arch.sie_block->gcr, sizeof(sregs->crs)); in kvm_arch_vcpu_ioctl_get_sregs()
463 memcpy(&vcpu->arch.guest_fpregs.fprs, &fpu->fprs, sizeof(fpu->fprs)); in kvm_arch_vcpu_ioctl_set_fpu()
464 vcpu->arch.guest_fpregs.fpc = fpu->fpc & FPC_VALID_MASK; in kvm_arch_vcpu_ioctl_set_fpu()
465 restore_fp_regs(&vcpu->arch.guest_fpregs); in kvm_arch_vcpu_ioctl_set_fpu()
471 memcpy(&fpu->fprs, &vcpu->arch.guest_fpregs.fprs, sizeof(fpu->fprs)); in kvm_arch_vcpu_ioctl_get_fpu()
472 fpu->fpc = vcpu->arch.guest_fpregs.fpc; in kvm_arch_vcpu_ioctl_get_fpu()
480 if (!(atomic_read(&vcpu->arch.sie_block->cpuflags) & CPUSTAT_STOPPED)) in kvm_arch_vcpu_ioctl_set_initial_psw()
517 memcpy(&vcpu->arch.sie_block->gg14, &vcpu->run->s.regs.gprs[14], 16); in __vcpu_run()
528 vcpu->arch.sie_block->icptcode = 0; in __vcpu_run()
533 atomic_read(&vcpu->arch.sie_block->cpuflags)); in __vcpu_run()
534 rc = sie64a(vcpu->arch.sie_block, vcpu->run->s.regs.gprs); in __vcpu_run()
545 vcpu->arch.sie_block->icptcode); in __vcpu_run()
550 memcpy(&vcpu->run->s.regs.gprs[14], &vcpu->arch.sie_block->gg14, 16); in __vcpu_run()
563 atomic_clear_mask(CPUSTAT_STOPPED, &vcpu->arch.sie_block->cpuflags); in kvm_arch_vcpu_ioctl_run()
565 BUG_ON(vcpu->kvm->arch.float_int.local_int[vcpu->vcpu_id] == NULL); in kvm_arch_vcpu_ioctl_run()
578 vcpu->arch.sie_block->gpsw.mask = kvm_run->psw_mask; in kvm_arch_vcpu_ioctl_run()
579 vcpu->arch.sie_block->gpsw.addr = kvm_run->psw_addr; in kvm_arch_vcpu_ioctl_run()
586 memcpy(&vcpu->arch.sie_block->gcr, &kvm_run->s.regs.crs, 128); in kvm_arch_vcpu_ioctl_run()
623 kvm_run->s390_sieic.icptcode = vcpu->arch.sie_block->icptcode; in kvm_arch_vcpu_ioctl_run()
624 kvm_run->s390_sieic.ipa = vcpu->arch.sie_block->ipa; in kvm_arch_vcpu_ioctl_run()
625 kvm_run->s390_sieic.ipb = vcpu->arch.sie_block->ipb; in kvm_arch_vcpu_ioctl_run()
635 kvm_run->psw_mask = vcpu->arch.sie_block->gpsw.mask; in kvm_arch_vcpu_ioctl_run()
636 kvm_run->psw_addr = vcpu->arch.sie_block->gpsw.addr; in kvm_arch_vcpu_ioctl_run()
637 kvm_run->s.regs.prefix = vcpu->arch.sie_block->prefix; in kvm_arch_vcpu_ioctl_run()
638 memcpy(&kvm_run->s.regs.crs, &vcpu->arch.sie_block->gcr, 128); in kvm_arch_vcpu_ioctl_run()
685 save_fp_regs(&vcpu->arch.guest_fpregs); in kvm_s390_vcpu_store_status()
689 vcpu->arch.guest_fpregs.fprs, 128, prefix)) in kvm_s390_vcpu_store_status()
697 &vcpu->arch.sie_block->gpsw, 16, prefix)) in kvm_s390_vcpu_store_status()
701 &vcpu->arch.sie_block->prefix, 4, prefix)) in kvm_s390_vcpu_store_status()
706 &vcpu->arch.guest_fpregs.fpc, 4, prefix)) in kvm_s390_vcpu_store_status()
710 &vcpu->arch.sie_block->todpr, 4, prefix)) in kvm_s390_vcpu_store_status()
714 &vcpu->arch.sie_block->cputm, 8, prefix)) in kvm_s390_vcpu_store_status()
718 &vcpu->arch.sie_block->ckc, 8, prefix)) in kvm_s390_vcpu_store_status()
727 &vcpu->arch.sie_block->gcr, 128, prefix)) in kvm_s390_vcpu_store_status()
778 r = gmap_map_segment(vcpu->arch.gmap, ucasmap.user_addr, in kvm_arch_vcpu_ioctl()
795 r = gmap_unmap_segment(vcpu->arch.gmap, ucasmap.vcpu_addr, in kvm_arch_vcpu_ioctl()
801 r = gmap_fault(arg, vcpu->arch.gmap); in kvm_arch_vcpu_ioctl()
817 vmf->page = virt_to_page(vcpu->arch.sie_block); in kvm_arch_vcpu_fault()
875 rc = gmap_map_segment(kvm->arch.gmap, mem->userspace_addr, in kvm_arch_commit_memory_region()