@@ -1100,6 +1100,7 @@ void kvm_mmio_write_buf(void *buf, unsigned int len, unsigned long data);
unsigned long kvm_mmio_read_buf(const void *buf, unsigned int len);
int kvm_handle_mmio_return(struct kvm_vcpu *vcpu);
+int kvm_handle_hypercall_return(struct kvm_vcpu *vcpu);
int io_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa);
/*
@@ -1092,11 +1092,9 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu)
if (ret <= 0)
return ret;
} else if (run->exit_reason == KVM_EXIT_HYPERCALL) {
- smccc_set_retval(vcpu,
- vcpu->run->hypercall.ret,
- vcpu->run->hypercall.args[0],
- vcpu->run->hypercall.args[1],
- vcpu->run->hypercall.args[2]);
+ ret = kvm_handle_hypercall_return(vcpu);
+ if (ret <= 0)
+ return ret;
}
vcpu_load(vcpu);
@@ -24,6 +24,16 @@
f; \
})
+int kvm_handle_hypercall_return(struct kvm_vcpu *vcpu)
+{
+ smccc_set_retval(vcpu, vcpu->run->hypercall.ret,
+ vcpu->run->hypercall.args[0],
+ vcpu->run->hypercall.args[1],
+ vcpu->run->hypercall.args[2]);
+
+ return 1;
+}
+
static void kvm_ptp_get_time(struct kvm_vcpu *vcpu, u64 *val)
{
struct system_time_snapshot systime_snapshot;
Instead of handling the hypercall return to guest from host inline, create a handler function. More logic will be added to this handler in subsequent patches. No functional change intended. Signed-off-by: Fuad Tabba <tabba@google.com> --- arch/arm64/include/asm/kvm_host.h | 1 + arch/arm64/kvm/arm.c | 8 +++----- arch/arm64/kvm/hypercalls.c | 10 ++++++++++ 3 files changed, 14 insertions(+), 5 deletions(-)