diff options
-rw-r--r-- | kvm.h | 10 | ||||
-rw-r--r-- | kvm_x86.c | 11 |
2 files changed, 20 insertions, 1 deletions
@@ -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; @@ -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); |