Use kvm_vcpu_ioctl directly instead. Signed-off-by: Marcelo Tosatti <mtosatti@xxxxxxxxxx> Index: qemu-kvm/qemu-kvm-x86.c =================================================================== --- qemu-kvm.orig/qemu-kvm-x86.c +++ qemu-kvm/qemu-kvm-x86.c @@ -825,7 +825,7 @@ void kvm_arch_load_regs(CPUState *env, i *(uint64_t *)&xsave->region[XSAVE_XSTATE_BV] = env->xstate_bv; memcpy(&xsave->region[XSAVE_YMMH_SPACE], env->ymmh_regs, sizeof env->ymmh_regs); - kvm_set_xsave(env, xsave); + kvm_vcpu_ioctl(env, KVM_SET_XSAVE, xsave); if (kvm_check_extension(kvm_state, KVM_CAP_XCRS)) { struct kvm_xcrs xcrs; @@ -833,7 +833,7 @@ void kvm_arch_load_regs(CPUState *env, i xcrs.flags = 0; xcrs.xcrs[0].xcr = 0; xcrs.xcrs[0].value = env->xcr0; - kvm_set_xcrs(env, &xcrs); + kvm_vcpu_ioctl(env, KVM_SET_XCRS, &xcrs); } qemu_free(xsave); } else { @@ -1011,7 +1011,7 @@ void kvm_arch_save_regs(CPUState *env) struct kvm_xsave* xsave; uint16_t cwd, swd, twd, fop; xsave = qemu_memalign(4096, sizeof(struct kvm_xsave)); - kvm_get_xsave(env, xsave); + kvm_vcpu_ioctl(env, KVM_GET_XSAVE, xsave); cwd = (uint16_t)xsave->region[0]; swd = (uint16_t)(xsave->region[0] >> 16); twd = (uint16_t)xsave->region[1]; @@ -1033,7 +1033,7 @@ void kvm_arch_save_regs(CPUState *env) if (kvm_check_extension(kvm_state, KVM_CAP_XCRS)) { struct kvm_xcrs xcrs; - kvm_get_xcrs(env, &xcrs); + kvm_vcpu_ioctl(env, KVM_GET_XCRS, &xcrs); if (xcrs.xcrs[0].xcr == 0) { env->xcr0 = xcrs.xcrs[0].value; } Index: qemu-kvm/qemu-kvm.c =================================================================== --- qemu-kvm.orig/qemu-kvm.c +++ qemu-kvm/qemu-kvm.c @@ -516,30 +516,6 @@ int kvm_set_mpstate(CPUState *env, struc } #endif -#ifdef KVM_CAP_XSAVE -int kvm_get_xsave(CPUState *env, struct kvm_xsave *xsave) -{ - return kvm_vcpu_ioctl(env, KVM_GET_XSAVE, xsave); -} - -int kvm_set_xsave(CPUState *env, struct kvm_xsave *xsave) -{ - return kvm_vcpu_ioctl(env, KVM_SET_XSAVE, xsave); -} -#endif - -#ifdef KVM_CAP_XCRS -int kvm_get_xcrs(CPUState *env, struct kvm_xcrs *xcrs) -{ - return kvm_vcpu_ioctl(env, KVM_GET_XCRS, xcrs); -} - -int kvm_set_xcrs(CPUState *env, struct kvm_xcrs *xcrs) -{ - return kvm_vcpu_ioctl(env, KVM_SET_XCRS, xcrs); -} -#endif - static int handle_mmio(CPUState *env) { unsigned long addr = env->kvm_run->mmio.phys_addr; Index: qemu-kvm/qemu-kvm.h =================================================================== --- qemu-kvm.orig/qemu-kvm.h +++ qemu-kvm/qemu-kvm.h @@ -284,34 +284,6 @@ int kvm_get_mpstate(CPUState *env, struc int kvm_set_mpstate(CPUState *env, struct kvm_mp_state *mp_state); #endif -#ifdef KVM_CAP_XSAVE -/*! - * * \brief Read VCPU xsave state - * - */ -int kvm_get_xsave(CPUState *env, struct kvm_xsave *xsave); - -/*! - * * \brief Write VCPU xsave state - * - */ -int kvm_set_xsave(CPUState *env, struct kvm_xsave *xsave); -#endif - -#ifdef KVM_CAP_XCRS -/*! - * * \brief Read VCPU XCRs - * - */ -int kvm_get_xcrs(CPUState *env, struct kvm_xcrs *xcrs); - -/*! - * * \brief Write VCPU XCRs - * - */ -int kvm_set_xcrs(CPUState *env, struct kvm_xcrs *xcrs); -#endif - /*! * \brief Simulate an external vectored interrupt * -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html