diff options
-rw-r--r-- | kvm.c | 11 | ||||
-rw-r--r-- | kvm.h | 5 | ||||
-rw-r--r-- | kvm_host.h | 2 | ||||
-rw-r--r-- | kvm_vmx.c | 6 | ||||
-rw-r--r-- | kvm_x86.c | 2 | ||||
-rw-r--r-- | kvm_x86host.h | 2 |
6 files changed, 8 insertions, 20 deletions
@@ -2310,20 +2310,13 @@ kvm_ioctl(dev_t dev, int cmd, intptr_t arg, int md, cred_t *cr, int *rv) } case KVM_SET_TSS_ADDR: { - struct kvm_tss kvm_tss; - struct kvm *kvmp; - if (copyin(argp, &kvm_tss, sizeof (kvm_tss)) != 0) { - rval = EFAULT; - break; - } - - if ((kvmp = ksp->kds_kvmp) == NULL) { + if (ksp->kds_kvmp == NULL) { rval = EINVAL; break; } - rval = kvm_vm_ioctl_set_tss_addr(kvmp, (caddr_t)kvm_tss.addr); + rval = kvm_vm_ioctl_set_tss_addr(ksp->kds_kvmp, arg); break; } @@ -484,11 +484,6 @@ typedef struct kvm_clock_data { /* * XXX Additions which probably are changes from qemu/kvm upstream */ -/* for KVM_SET_TSS_ADDR ioctl */ -typedef struct kvm_tss { - uint64_t addr; /* in */ -} kvm_tss_t; - typedef struct kvm_tpr_acl_ioc { struct kvm_tpr_access_ctl tac; int kvm_id; @@ -333,7 +333,7 @@ int kvm_vm_ioctl_set_memory_region(struct kvm *kvm, struct kvm_userspace_memory_region *mem, int user_alloc); -int kvm_vm_ioctl_set_tss_addr(struct kvm *kvmp, caddr_t addr); +int kvm_vm_ioctl_set_tss_addr(struct kvm *kvmp, uintptr_t addr); int kvm_vm_ioctl_get_irqchip(struct kvm *kvm, struct kvm_irqchip *chip); int kvm_vm_ioctl_set_irqchip(struct kvm *kvm, struct kvm_irqchip *chip); @@ -2989,13 +2989,13 @@ vmx_interrupt_allowed(struct kvm_vcpu *vcpu) /* XXX Should be static! */ int -vmx_set_tss_addr(struct kvm *kvmp, caddr_t addr) +vmx_set_tss_addr(struct kvm *kvmp, uintptr_t addr) { int ret; struct kvm_userspace_memory_region tss_mem = { .slot = TSS_PRIVATE_MEMSLOT, - .guest_phys_addr = (uint64_t)addr, + .guest_phys_addr = addr, .memory_size = PAGESIZE * 3, .flags = 0, }; @@ -3005,7 +3005,7 @@ vmx_set_tss_addr(struct kvm *kvmp, caddr_t addr) if (ret) return (ret); - kvmp->arch.tss_addr = (uint64_t)addr; + kvmp->arch.tss_addr = addr; return (DDI_SUCCESS); } @@ -2054,7 +2054,7 @@ kvm_vcpu_ioctl_x86_set_vcpu_events(struct kvm_vcpu *vcpu, } int -kvm_vm_ioctl_set_tss_addr(struct kvm *kvmp, caddr_t addr) +kvm_vm_ioctl_set_tss_addr(struct kvm *kvmp, uintptr_t addr) { /* * XXX They have some other code here to check the validity of the diff --git a/kvm_x86host.h b/kvm_x86host.h index e52a618..2f8e83f 100644 --- a/kvm_x86host.h +++ b/kvm_x86host.h @@ -631,7 +631,7 @@ typedef struct kvm_x86_ops { void (*enable_nmi_window)(struct kvm_vcpu *vcpu); void (*enable_irq_window)(struct kvm_vcpu *vcpu); void (*update_cr8_intercept)(struct kvm_vcpu *vcpu, int tpr, int irr); - int (*set_tss_addr)(struct kvm *kvm, caddr_t addr); + int (*set_tss_addr)(struct kvm *kvm, uintptr_t addr); int (*get_tdp_level)(void); uint64_t (*get_mt_mask)(struct kvm_vcpu *vcpu, gfn_t gfn, int is_mmio); int (*get_lpage_level)(void); |