Lines Matching full:run
157 int kvm_emu_iocsr(larch_inst inst, struct kvm_run *run, struct kvm_vcpu *vcpu) in kvm_emu_iocsr() argument
171 run->iocsr_io.phys_addr = addr; in kvm_emu_iocsr()
172 run->iocsr_io.is_write = 0; in kvm_emu_iocsr()
177 run->iocsr_io.len = 1; in kvm_emu_iocsr()
180 run->iocsr_io.len = 2; in kvm_emu_iocsr()
183 run->iocsr_io.len = 4; in kvm_emu_iocsr()
186 run->iocsr_io.len = 8; in kvm_emu_iocsr()
189 run->iocsr_io.len = 1; in kvm_emu_iocsr()
190 run->iocsr_io.is_write = 1; in kvm_emu_iocsr()
193 run->iocsr_io.len = 2; in kvm_emu_iocsr()
194 run->iocsr_io.is_write = 1; in kvm_emu_iocsr()
197 run->iocsr_io.len = 4; in kvm_emu_iocsr()
198 run->iocsr_io.is_write = 1; in kvm_emu_iocsr()
201 run->iocsr_io.len = 8; in kvm_emu_iocsr()
202 run->iocsr_io.is_write = 1; in kvm_emu_iocsr()
210 if (run->iocsr_io.is_write) { in kvm_emu_iocsr()
212 memcpy(run->iocsr_io.data, &val, run->iocsr_io.len); in kvm_emu_iocsr()
220 int kvm_complete_iocsr_read(struct kvm_vcpu *vcpu, struct kvm_run *run) in kvm_complete_iocsr_read() argument
225 switch (run->iocsr_io.len) { in kvm_complete_iocsr_read()
227 *gpr = *(s8 *)run->iocsr_io.data; in kvm_complete_iocsr_read()
230 *gpr = *(s16 *)run->iocsr_io.data; in kvm_complete_iocsr_read()
233 *gpr = *(s32 *)run->iocsr_io.data; in kvm_complete_iocsr_read()
236 *gpr = *(s64 *)run->iocsr_io.data; in kvm_complete_iocsr_read()
240 run->iocsr_io.len, vcpu->arch.badv); in kvm_complete_iocsr_read()
264 struct kvm_run *run = vcpu->run; in kvm_trap_handle_gspr() local
289 er = kvm_emu_iocsr(inst, run, vcpu); in kvm_trap_handle_gspr()
337 vcpu->run->exit_reason = KVM_EXIT_MMIO; in kvm_handle_gspr()
340 vcpu->run->exit_reason = KVM_EXIT_LOONGARCH_IOCSR; in kvm_handle_gspr()
354 struct kvm_run *run = vcpu->run; in kvm_emu_mmio_read() local
356 run->mmio.phys_addr = vcpu->arch.badv; in kvm_emu_mmio_read()
368 run->mmio.len = 4; in kvm_emu_mmio_read()
371 run->mmio.len = 8; in kvm_emu_mmio_read()
383 run->mmio.len = 1; in kvm_emu_mmio_read()
387 run->mmio.len = 1; in kvm_emu_mmio_read()
390 run->mmio.len = 2; in kvm_emu_mmio_read()
394 run->mmio.len = 2; in kvm_emu_mmio_read()
397 run->mmio.len = 4; in kvm_emu_mmio_read()
401 run->mmio.len = 4; in kvm_emu_mmio_read()
404 run->mmio.len = 8; in kvm_emu_mmio_read()
417 run->mmio.len = 1; in kvm_emu_mmio_read()
420 run->mmio.len = 1; in kvm_emu_mmio_read()
424 run->mmio.len = 2; in kvm_emu_mmio_read()
427 run->mmio.len = 2; in kvm_emu_mmio_read()
431 run->mmio.len = 4; in kvm_emu_mmio_read()
434 run->mmio.len = 4; in kvm_emu_mmio_read()
438 run->mmio.len = 8; in kvm_emu_mmio_read()
452 run->mmio.is_write = 0; in kvm_emu_mmio_read()
454 trace_kvm_mmio(KVM_TRACE_MMIO_READ_UNSATISFIED, run->mmio.len, in kvm_emu_mmio_read()
455 run->mmio.phys_addr, NULL); in kvm_emu_mmio_read()
466 int kvm_complete_mmio_read(struct kvm_vcpu *vcpu, struct kvm_run *run) in kvm_complete_mmio_read() argument
473 switch (run->mmio.len) { in kvm_complete_mmio_read()
476 *gpr = *(s8 *)run->mmio.data; in kvm_complete_mmio_read()
478 *gpr = *(u8 *)run->mmio.data; in kvm_complete_mmio_read()
482 *gpr = *(s16 *)run->mmio.data; in kvm_complete_mmio_read()
484 *gpr = *(u16 *)run->mmio.data; in kvm_complete_mmio_read()
488 *gpr = *(s32 *)run->mmio.data; in kvm_complete_mmio_read()
490 *gpr = *(u32 *)run->mmio.data; in kvm_complete_mmio_read()
493 *gpr = *(s64 *)run->mmio.data; in kvm_complete_mmio_read()
497 run->mmio.len, vcpu->arch.badv); in kvm_complete_mmio_read()
502 trace_kvm_mmio(KVM_TRACE_MMIO_READ, run->mmio.len, in kvm_complete_mmio_read()
503 run->mmio.phys_addr, run->mmio.data); in kvm_complete_mmio_read()
513 struct kvm_run *run = vcpu->run; in kvm_emu_mmio_write() local
514 void *data = run->mmio.data; in kvm_emu_mmio_write()
524 run->mmio.phys_addr = vcpu->arch.badv; in kvm_emu_mmio_write()
533 run->mmio.len = 4; in kvm_emu_mmio_write()
537 run->mmio.len = 8; in kvm_emu_mmio_write()
552 run->mmio.len = 1; in kvm_emu_mmio_write()
556 run->mmio.len = 2; in kvm_emu_mmio_write()
560 run->mmio.len = 4; in kvm_emu_mmio_write()
564 run->mmio.len = 8; in kvm_emu_mmio_write()
578 run->mmio.len = 1; in kvm_emu_mmio_write()
582 run->mmio.len = 2; in kvm_emu_mmio_write()
586 run->mmio.len = 4; in kvm_emu_mmio_write()
590 run->mmio.len = 8; in kvm_emu_mmio_write()
603 run->mmio.is_write = 1; in kvm_emu_mmio_write()
606 trace_kvm_mmio(KVM_TRACE_MMIO_WRITE, run->mmio.len, in kvm_emu_mmio_write()
607 run->mmio.phys_addr, data); in kvm_emu_mmio_write()
624 struct kvm_run *run = vcpu->run; in kvm_handle_rdwr_fault() local
647 run->exit_reason = KVM_EXIT_MMIO; in kvm_handle_rdwr_fault()
676 struct kvm_run *run = vcpu->run; in kvm_handle_fpu_disabled() local
690 run->exit_reason = KVM_EXIT_INTERNAL_ERROR; in kvm_handle_fpu_disabled()
834 vcpu->run->exit_reason = KVM_EXIT_DEBUG; in kvm_handle_hypercall()