Lines Matching refs:run

300 	int (*get) (struct kvm_run *run, struct kvm_vcpu *vcpu, u32 addr, u64 *res);
301 int (*set) (struct kvm_run *run, struct kvm_vcpu *vcpu, u32 addr, u64 val);
316 static int kvm_iocsr_common_get(struct kvm_run *run, struct kvm_vcpu *vcpu,
332 static int kvm_iocsr_common_set(struct kvm_run *run, struct kvm_vcpu *vcpu,
348 static int kvm_misc_set(struct kvm_run *run, struct kvm_vcpu *vcpu, u32 addr,
351 return kvm_iocsr_common_set(run, vcpu, addr, val);
354 static int kvm_ipi_get(struct kvm_run *run, struct kvm_vcpu *vcpu, u32 addr,
360 run->mmio.phys_addr = KVM_IPI_REG_ADDRESS(vcpu->vcpu_id, (addr & 0xff));
361 ret = kvm_io_bus_read(vcpu, KVM_MMIO_BUS, run->mmio.phys_addr,
362 run->mmio.len, res);
364 run->mmio.is_write = 0;
372 static int kvm_extioi_isr_get(struct kvm_run *run, struct kvm_vcpu *vcpu,
377 run->mmio.phys_addr = EXTIOI_PERCORE_ADDR(vcpu->vcpu_id, (addr & 0xff));
378 ret = kvm_io_bus_read(vcpu, KVM_MMIO_BUS, run->mmio.phys_addr,
379 run->mmio.len, res);
381 run->mmio.is_write = 0;
390 static int kvm_ipi_set(struct kvm_run *run, struct kvm_vcpu *vcpu, u32 addr,
395 run->mmio.phys_addr = KVM_IPI_REG_ADDRESS(vcpu->vcpu_id, (addr & 0xff));
396 ret = kvm_io_bus_write(vcpu, KVM_MMIO_BUS, run->mmio.phys_addr,
397 run->mmio.len, &val);
399 run->mmio.is_write = 1;
408 static int kvm_extioi_set(struct kvm_run *run, struct kvm_vcpu *vcpu, u32 addr,
414 run->mmio.phys_addr = EXTIOI_PERCORE_ADDR(vcpu->vcpu_id, (addr & 0xff));
416 run->mmio.phys_addr = EXTIOI_ADDR((addr & 0x1fff));
419 ret = kvm_io_bus_write(vcpu, KVM_MMIO_BUS, run->mmio.phys_addr,
420 run->mmio.len, &val);
422 memcpy(run->mmio.data, &val, run->mmio.len);
423 run->mmio.is_write = 1;
432 static int kvm_nop_set(struct kvm_run *run, struct kvm_vcpu *vcpu, u32 addr,
469 static int _kvm_emu_iocsr_read(struct kvm_run *run, struct kvm_vcpu *vcpu,
477 run->iocsr_io.len = run->mmio.len;
478 run->iocsr_io.phys_addr = addr;
479 run->iocsr_io.is_write = 0;
486 er = iocsr->get(run, vcpu, addr, res);
496 static int _kvm_emu_iocsr_write(struct kvm_run *run, struct kvm_vcpu *vcpu,
504 run->iocsr_io.len = run->mmio.len;
505 memcpy(run->iocsr_io.data, &val, run->iocsr_io.len);
506 run->iocsr_io.phys_addr = addr;
507 run->iocsr_io.is_write = 1;
514 er = iocsr->set(run, vcpu, addr, val);
525 struct kvm_run *run, struct kvm_vcpu *vcpu)
543 run->mmio.len = 1;
544 ret = _kvm_emu_iocsr_read(run, vcpu, val, &res);
548 run->mmio.len = 2;
549 ret = _kvm_emu_iocsr_read(run, vcpu, val, &res);
553 run->mmio.len = 4;
554 ret = _kvm_emu_iocsr_read(run, vcpu, val, &res);
558 run->mmio.len = 8;
559 ret = _kvm_emu_iocsr_read(run, vcpu, val, &res);
563 run->mmio.len = 1;
564 ret = _kvm_emu_iocsr_write(run, vcpu, val, (u8)res);
567 run->mmio.len = 2;
568 ret = _kvm_emu_iocsr_write(run, vcpu, val, (u16)res);
571 run->mmio.len = 4;
572 ret = _kvm_emu_iocsr_write(run, vcpu, val, (u32)res);
575 run->mmio.len = 8;
576 ret = _kvm_emu_iocsr_write(run, vcpu, val, res);
590 int _kvm_complete_iocsr_read(struct kvm_vcpu *vcpu, struct kvm_run *run)
595 switch (run->iocsr_io.len) {
597 *gpr = *(s64 *)run->iocsr_io.data;
600 *gpr = *(int *)run->iocsr_io.data;
603 *gpr = *(short *)run->iocsr_io.data;
606 *gpr = *(char *) run->iocsr_io.data;
610 run->iocsr_io.len, vcpu->arch.badv);