Loading arch/x86/kvm/x86.c +1 −13 Original line number Diff line number Diff line Loading @@ -5627,19 +5627,7 @@ long kvm_arch_vm_ioctl(struct file *filp, r = -EFAULT; if (copy_from_user(&xhc, argp, sizeof(xhc))) goto out; r = -EINVAL; if (xhc.flags & ~KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL) goto out; /* * With hypercall interception the kernel generates its own * hypercall page so it must not be provided. */ if ((xhc.flags & KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL) && (xhc.blob_addr_32 || xhc.blob_addr_64 || xhc.blob_size_32 || xhc.blob_size_64)) goto out; memcpy(&kvm->arch.xen_hvm_config, &xhc, sizeof(xhc)); r = 0; r = kvm_xen_hvm_config(kvm, &xhc); break; } case KVM_SET_CLOCK: { Loading arch/x86/kvm/xen.c +18 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,24 @@ int kvm_xen_write_hypercall_page(struct kvm_vcpu *vcpu, u64 data) return 0; } int kvm_xen_hvm_config(struct kvm *kvm, struct kvm_xen_hvm_config *xhc) { if (xhc->flags & ~KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL) return -EINVAL; /* * With hypercall interception the kernel generates its own * hypercall page so it must not be provided. */ if ((xhc->flags & KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL) && (xhc->blob_addr_32 || xhc->blob_addr_64 || xhc->blob_size_32 || xhc->blob_size_64)) return -EINVAL; memcpy(&kvm->arch.xen_hvm_config, xhc, sizeof(*xhc)); return 0; } static int kvm_xen_hypercall_set_result(struct kvm_vcpu *vcpu, u64 result) { kvm_rax_write(vcpu, result); Loading arch/x86/kvm/xen.h +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ int kvm_xen_hypercall(struct kvm_vcpu *vcpu); int kvm_xen_write_hypercall_page(struct kvm_vcpu *vcpu, u64 data); int kvm_xen_hvm_config(struct kvm *kvm, struct kvm_xen_hvm_config *xhc); static inline bool kvm_xen_hypercall_enabled(struct kvm *kvm) { Loading Loading
arch/x86/kvm/x86.c +1 −13 Original line number Diff line number Diff line Loading @@ -5627,19 +5627,7 @@ long kvm_arch_vm_ioctl(struct file *filp, r = -EFAULT; if (copy_from_user(&xhc, argp, sizeof(xhc))) goto out; r = -EINVAL; if (xhc.flags & ~KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL) goto out; /* * With hypercall interception the kernel generates its own * hypercall page so it must not be provided. */ if ((xhc.flags & KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL) && (xhc.blob_addr_32 || xhc.blob_addr_64 || xhc.blob_size_32 || xhc.blob_size_64)) goto out; memcpy(&kvm->arch.xen_hvm_config, &xhc, sizeof(xhc)); r = 0; r = kvm_xen_hvm_config(kvm, &xhc); break; } case KVM_SET_CLOCK: { Loading
arch/x86/kvm/xen.c +18 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,24 @@ int kvm_xen_write_hypercall_page(struct kvm_vcpu *vcpu, u64 data) return 0; } int kvm_xen_hvm_config(struct kvm *kvm, struct kvm_xen_hvm_config *xhc) { if (xhc->flags & ~KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL) return -EINVAL; /* * With hypercall interception the kernel generates its own * hypercall page so it must not be provided. */ if ((xhc->flags & KVM_XEN_HVM_CONFIG_INTERCEPT_HCALL) && (xhc->blob_addr_32 || xhc->blob_addr_64 || xhc->blob_size_32 || xhc->blob_size_64)) return -EINVAL; memcpy(&kvm->arch.xen_hvm_config, xhc, sizeof(*xhc)); return 0; } static int kvm_xen_hypercall_set_result(struct kvm_vcpu *vcpu, u64 result) { kvm_rax_write(vcpu, result); Loading
arch/x86/kvm/xen.h +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ int kvm_xen_hypercall(struct kvm_vcpu *vcpu); int kvm_xen_write_hypercall_page(struct kvm_vcpu *vcpu, u64 data); int kvm_xen_hvm_config(struct kvm *kvm, struct kvm_xen_hvm_config *xhc); static inline bool kvm_xen_hypercall_enabled(struct kvm *kvm) { Loading