diff options
author | Marcelo Tosatti <mtosatti@redhat.com> | 2010-05-01 15:30:41 -0300 |
---|---|---|
committer | Marcelo Tosatti <mtosatti@redhat.com> | 2010-05-01 15:30:41 -0300 |
commit | 383ed3e00151998736b4933eca5fe394f7080f58 (patch) | |
tree | 1070333a56135bb9a16df8a27d4dfc6fbd59ab45 /kvm-all.c | |
parent | 26ed265b50c1fd85a91054a7b25c90d839d75168 (diff) | |
parent | 98c8573eb37bf5d7bb0c07225985a78537c73101 (diff) |
Merge commit '98c8573eb37bf5d7bb0c07225985a78537c73101' into upstream-merge
* commit '98c8573eb37bf5d7bb0c07225985a78537c73101': (75 commits)
provide a stub version of kvm-all.c if !CONFIG_KVM
tcg/arm: don't try to load constants using pc
tcg/arm: optimize register allocation order
tcg/arm: fix argument alignment in qemu_st64
tcg/arm: remove useless register tests in qemu_ld/st
tcg/arm: bswap arguments in qemu_ld/st if needed
tcg/arm: use ext* ops in qemu_ld
tcg/arm: remove conditional argument for qemu_ld/st
tcg/arm: add bswap ops
tcg/arm: add ext16u op
tcg/arm: add rotation ops
tcg/arm: use the blx instruction when possible
tcg/arm: sxtb and sxth are available starting with ARMv6
tcg/arm: add variables to define the allowed instructions set
tcg/arm: align 64-bit arguments in function calls
tcg/arm: replace integer values by registers enum
tcg/arm: remove store signed functions
tcg/arm: explicitely list clobbered/reserved regs
tcg/arm: remove SAVE_LR code
Check for invalid initrd file
...
Conflicts:
Makefile.target
kvm-all.c
kvm.h
vl.c
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'kvm-all.c')
-rw-r--r-- | kvm-all.c | 46 |
1 files changed, 24 insertions, 22 deletions
@@ -34,10 +34,10 @@ //#define DEBUG_KVM #ifdef DEBUG_KVM -#define dprintf(fmt, ...) \ +#define DPRINTF(fmt, ...) \ do { fprintf(stderr, fmt, ## __VA_ARGS__); } while (0) #else -#define dprintf(fmt, ...) \ +#define DPRINTF(fmt, ...) \ do { } while (0) #endif @@ -177,11 +177,11 @@ int kvm_init_vcpu(CPUState *env) long mmap_size; int ret; - dprintf("kvm_init_vcpu\n"); + DPRINTF("kvm_init_vcpu\n"); ret = kvm_vm_ioctl(s, KVM_CREATE_VCPU, env->cpu_index); if (ret < 0) { - dprintf("kvm_create_vcpu failed\n"); + DPRINTF("kvm_create_vcpu failed\n"); goto err; } @@ -190,7 +190,7 @@ int kvm_init_vcpu(CPUState *env) mmap_size = kvm_ioctl(s, KVM_GET_VCPU_MMAP_SIZE, 0); if (mmap_size < 0) { - dprintf("KVM_GET_VCPU_MMAP_SIZE failed\n"); + DPRINTF("KVM_GET_VCPU_MMAP_SIZE failed\n"); goto err; } @@ -198,7 +198,7 @@ int kvm_init_vcpu(CPUState *env) env->kvm_fd, 0); if (env->kvm_run == MAP_FAILED) { ret = -errno; - dprintf("mmap'ing vcpu state failed\n"); + DPRINTF("mmap'ing vcpu state failed\n"); goto err; } @@ -329,7 +329,7 @@ static int kvm_physical_sync_dirty_bitmap(target_phys_addr_t start_addr, d.slot = mem->slot; if (kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) == -1) { - dprintf("ioctl failed %d\n", errno); + DPRINTF("ioctl failed %d\n", errno); ret = -1; break; } @@ -792,12 +792,12 @@ int kvm_cpu_exec(CPUState *env) struct kvm_run *run = env->kvm_run; int ret; - dprintf("kvm_cpu_exec()\n"); + DPRINTF("kvm_cpu_exec()\n"); do { #ifndef CONFIG_IOTHREAD if (env->exit_request) { - dprintf("interrupt exit requested\n"); + DPRINTF("interrupt exit requested\n"); ret = 0; break; } @@ -816,13 +816,13 @@ int kvm_cpu_exec(CPUState *env) if (ret == -EINTR || ret == -EAGAIN) { cpu_exit(env); - dprintf("io window exit\n"); + DPRINTF("io window exit\n"); ret = 0; break; } if (ret < 0) { - dprintf("kvm run failed %s\n", strerror(-ret)); + DPRINTF("kvm run failed %s\n", strerror(-ret)); abort(); } @@ -831,7 +831,7 @@ int kvm_cpu_exec(CPUState *env) ret = 0; /* exit loop */ switch (run->exit_reason) { case KVM_EXIT_IO: - dprintf("handle_io\n"); + DPRINTF("handle_io\n"); ret = kvm_handle_io(run->io.port, (uint8_t *)run + run->io.data_offset, run->io.direction, @@ -839,7 +839,7 @@ int kvm_cpu_exec(CPUState *env) run->io.count); break; case KVM_EXIT_MMIO: - dprintf("handle_mmio\n"); + DPRINTF("handle_mmio\n"); cpu_physical_memory_rw(run->mmio.phys_addr, run->mmio.data, run->mmio.len, @@ -847,24 +847,24 @@ int kvm_cpu_exec(CPUState *env) ret = 1; break; case KVM_EXIT_IRQ_WINDOW_OPEN: - dprintf("irq_window_open\n"); + DPRINTF("irq_window_open\n"); break; case KVM_EXIT_SHUTDOWN: - dprintf("shutdown\n"); + DPRINTF("shutdown\n"); qemu_system_reset_request(); ret = 1; break; case KVM_EXIT_UNKNOWN: - dprintf("kvm_exit_unknown\n"); + DPRINTF("kvm_exit_unknown\n"); break; case KVM_EXIT_FAIL_ENTRY: - dprintf("kvm_exit_fail_entry\n"); + DPRINTF("kvm_exit_fail_entry\n"); break; case KVM_EXIT_EXCEPTION: - dprintf("kvm_exit_exception\n"); + DPRINTF("kvm_exit_exception\n"); break; case KVM_EXIT_DEBUG: - dprintf("kvm_exit_debug\n"); + DPRINTF("kvm_exit_debug\n"); #ifdef KVM_CAP_SET_GUEST_DEBUG if (kvm_arch_debug(&run->debug.arch)) { gdb_set_stop_cpu(env); @@ -877,7 +877,7 @@ int kvm_cpu_exec(CPUState *env) #endif /* KVM_CAP_SET_GUEST_DEBUG */ break; default: - dprintf("kvm_arch_handle_exit\n"); + DPRINTF("kvm_arch_handle_exit\n"); ret = kvm_arch_handle_exit(env, run); break; } @@ -1192,9 +1192,9 @@ int kvm_set_signal_mask(CPUState *env, const sigset_t *sigset) return r; } -#ifdef KVM_IOEVENTFD int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val, bool assign) { +#ifdef KVM_IOEVENTFD struct kvm_ioeventfd kick = { .datamatch = val, .addr = addr, @@ -1211,8 +1211,10 @@ int kvm_set_ioeventfd_pio_word(int fd, uint16_t addr, uint16_t val, bool assign) if (r < 0) return r; return 0; -} +#else + return -ENOSYS; #endif +} #if defined(KVM_IRQFD) int kvm_set_irqfd(int gsi, int fd, bool assigned) |