Loading drivers/kvm/kvm_main.c +17 −1 Original line number Original line Diff line number Diff line Loading @@ -1203,7 +1203,16 @@ int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run) } } switch (nr) { switch (nr) { default: default: ; run->hypercall.args[0] = a0; run->hypercall.args[1] = a1; run->hypercall.args[2] = a2; run->hypercall.args[3] = a3; run->hypercall.args[4] = a4; run->hypercall.args[5] = a5; run->hypercall.ret = ret; run->hypercall.longmode = is_long_mode(vcpu); kvm_arch_ops->decache_regs(vcpu); return 0; } } vcpu->regs[VCPU_REGS_RAX] = ret; vcpu->regs[VCPU_REGS_RAX] = ret; kvm_arch_ops->decache_regs(vcpu); kvm_arch_ops->decache_regs(vcpu); Loading Loading @@ -1599,6 +1608,13 @@ static int kvm_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) vcpu->mmio_needed = 0; vcpu->mmio_needed = 0; if (kvm_run->exit_type == KVM_EXIT_TYPE_VM_EXIT && kvm_run->exit_reason == KVM_EXIT_HYPERCALL) { kvm_arch_ops->cache_regs(vcpu); vcpu->regs[VCPU_REGS_RAX] = kvm_run->hypercall.ret; kvm_arch_ops->decache_regs(vcpu); } r = kvm_arch_ops->run(vcpu, kvm_run); r = kvm_arch_ops->run(vcpu, kvm_run); vcpu_put(vcpu); vcpu_put(vcpu); Loading include/linux/kvm.h +9 −1 Original line number Original line Diff line number Diff line Loading @@ -11,7 +11,7 @@ #include <asm/types.h> #include <asm/types.h> #include <linux/ioctl.h> #include <linux/ioctl.h> #define KVM_API_VERSION 6 #define KVM_API_VERSION 7 /* /* * Architectural interrupt line count, and the size of the bitmap needed * Architectural interrupt line count, and the size of the bitmap needed Loading Loading @@ -41,6 +41,7 @@ enum kvm_exit_reason { KVM_EXIT_UNKNOWN = 0, KVM_EXIT_UNKNOWN = 0, KVM_EXIT_EXCEPTION = 1, KVM_EXIT_EXCEPTION = 1, KVM_EXIT_IO = 2, KVM_EXIT_IO = 2, KVM_EXIT_HYPERCALL = 3, KVM_EXIT_DEBUG = 4, KVM_EXIT_DEBUG = 4, KVM_EXIT_HLT = 5, KVM_EXIT_HLT = 5, KVM_EXIT_MMIO = 6, KVM_EXIT_MMIO = 6, Loading Loading @@ -103,6 +104,13 @@ struct kvm_run { __u32 len; __u32 len; __u8 is_write; __u8 is_write; } mmio; } mmio; /* KVM_EXIT_HYPERCALL */ struct { __u64 args[6]; __u64 ret; __u32 longmode; __u32 pad; } hypercall; }; }; }; }; Loading Loading
drivers/kvm/kvm_main.c +17 −1 Original line number Original line Diff line number Diff line Loading @@ -1203,7 +1203,16 @@ int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run) } } switch (nr) { switch (nr) { default: default: ; run->hypercall.args[0] = a0; run->hypercall.args[1] = a1; run->hypercall.args[2] = a2; run->hypercall.args[3] = a3; run->hypercall.args[4] = a4; run->hypercall.args[5] = a5; run->hypercall.ret = ret; run->hypercall.longmode = is_long_mode(vcpu); kvm_arch_ops->decache_regs(vcpu); return 0; } } vcpu->regs[VCPU_REGS_RAX] = ret; vcpu->regs[VCPU_REGS_RAX] = ret; kvm_arch_ops->decache_regs(vcpu); kvm_arch_ops->decache_regs(vcpu); Loading Loading @@ -1599,6 +1608,13 @@ static int kvm_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) vcpu->mmio_needed = 0; vcpu->mmio_needed = 0; if (kvm_run->exit_type == KVM_EXIT_TYPE_VM_EXIT && kvm_run->exit_reason == KVM_EXIT_HYPERCALL) { kvm_arch_ops->cache_regs(vcpu); vcpu->regs[VCPU_REGS_RAX] = kvm_run->hypercall.ret; kvm_arch_ops->decache_regs(vcpu); } r = kvm_arch_ops->run(vcpu, kvm_run); r = kvm_arch_ops->run(vcpu, kvm_run); vcpu_put(vcpu); vcpu_put(vcpu); Loading
include/linux/kvm.h +9 −1 Original line number Original line Diff line number Diff line Loading @@ -11,7 +11,7 @@ #include <asm/types.h> #include <asm/types.h> #include <linux/ioctl.h> #include <linux/ioctl.h> #define KVM_API_VERSION 6 #define KVM_API_VERSION 7 /* /* * Architectural interrupt line count, and the size of the bitmap needed * Architectural interrupt line count, and the size of the bitmap needed Loading Loading @@ -41,6 +41,7 @@ enum kvm_exit_reason { KVM_EXIT_UNKNOWN = 0, KVM_EXIT_UNKNOWN = 0, KVM_EXIT_EXCEPTION = 1, KVM_EXIT_EXCEPTION = 1, KVM_EXIT_IO = 2, KVM_EXIT_IO = 2, KVM_EXIT_HYPERCALL = 3, KVM_EXIT_DEBUG = 4, KVM_EXIT_DEBUG = 4, KVM_EXIT_HLT = 5, KVM_EXIT_HLT = 5, KVM_EXIT_MMIO = 6, KVM_EXIT_MMIO = 6, Loading Loading @@ -103,6 +104,13 @@ struct kvm_run { __u32 len; __u32 len; __u8 is_write; __u8 is_write; } mmio; } mmio; /* KVM_EXIT_HYPERCALL */ struct { __u64 args[6]; __u64 ret; __u32 longmode; __u32 pad; } hypercall; }; }; }; }; Loading