Lets cheat some more and ignore MMIO accesses altogether.
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
OBJS += ioport.o
OBJS += kvm.o
OBJS += main.o
+OBJS += mmio.o
OBJS += util.o
-OBJS += bios/c-intfake.o
OBJS += bios/c-int10.o
+OBJS += bios/c-intfake.o
CFLAGS += $(CPPFLAGS) -Iinclude -g
void kvm__reset_vcpu(struct kvm *self);
void kvm__run(struct kvm *self);
bool kvm__emulate_io(struct kvm *self, uint16_t port, void *data, int direction, int size, uint32_t count);
+bool kvm__emulate_mmio(struct kvm *self, uint64_t phys_addr, uint8_t *data, uint32_t len, uint8_t is_write);
/*
* Debugging
goto exit_kvm;
break;
}
+ case KVM_EXIT_MMIO: {
+ bool ret;
+
+ ret = kvm__emulate_mmio(kvm,
+ kvm->kvm_run->mmio.phys_addr,
+ kvm->kvm_run->mmio.data,
+ kvm->kvm_run->mmio.len,
+ kvm->kvm_run->mmio.is_write);
+
+ if (!ret)
+ goto exit_kvm;
+ break;
+
+ }
default:
goto exit_kvm;
}
--- /dev/null
+#include "kvm/kvm.h"
+
+#include <stdio.h>
+
+static const char *to_direction(uint8_t is_write)
+{
+ if (is_write)
+ return "write";
+
+ return "read";
+}
+
+bool kvm__emulate_mmio(struct kvm *self, uint64_t phys_addr, uint8_t *data, uint32_t len, uint8_t is_write)
+{
+ fprintf(stderr, "Warning: Ignoring MMIO %s at %016" PRIx64 " (length %" PRIu32 ")\n",
+ to_direction(is_write), phys_addr, len);
+
+ return true;
+}