summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kvm.h10
-rw-r--r--kvm_x86.c11
2 files changed, 20 insertions, 1 deletions
diff --git a/kvm.h b/kvm.h
index 83a6354..9d02fd3 100644
--- a/kvm.h
+++ b/kvm.h
@@ -1286,6 +1286,16 @@ struct kvm_run {
uint64_t psw_addr; /* psw lower half */
#endif
union {
+ /*
+ * As a temporary hack, we set the PFNs for programmed I/O and
+ * memory-mapped I/O upon initialization to allow them to be
+ * mmap'd after the kvm_run structure.
+ */
+ struct {
+ uint64_t xxx_pio_paddr;
+ uint64_t xxx_mmio_paddr;
+ } xxx_paddrs;
+
/* KVM_EXIT_UNKNOWN */
struct {
uint64_t hardware_exit_reason;
diff --git a/kvm_x86.c b/kvm_x86.c
index dac7a3b..4f31c82 100644
--- a/kvm_x86.c
+++ b/kvm_x86.c
@@ -1492,7 +1492,16 @@ kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, struct kvm_vcpu_ioc *arg,
vcpu->run = (struct kvm_run *)page_address(page);
kvm_run = (caddr_t)vcpu->run;
- arg->kvm_run_addr = (hat_getpfnum(kas.a_hat, kvm_run)<<PAGESHIFT)|((uint64_t)kvm_run&PAGEOFFSET);
+ arg->kvm_run_addr =
+ (hat_getpfnum(kas.a_hat, kvm_run) << PAGESHIFT) |
+ ((uint64_t)kvm_run & PAGEOFFSET);
+
+ vcpu->run->xxx_paddrs.xxx_pio_paddr =
+ hat_getpfnum(kas.a_hat, kvm_run + PAGESIZE) << PAGESHIFT;
+
+ vcpu->run->xxx_paddrs.xxx_mmio_paddr =
+ hat_getpfnum(kas.a_hat, kvm_run + (2 * PAGESIZE)) << PAGESHIFT;
+
arg->kvm_vcpu_addr = (uint64_t)vcpu;
r = kvm_arch_vcpu_init(vcpu);