[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit
From: |
Pavel Fedin |
Subject: |
Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit |
Date: |
Mon, 21 Dec 2015 18:21:38 +0300 |
Hello!
> > It depends. Can i read about these hypercalls somewhere? Is there any
> > documentation?
> I don't know about a documentation, but you can look at the code of
> Hyper-V hypercall handling inside KVM:
>
> https://github.com/torvalds/linux/blob/master/arch/x86/kvm/hyperv.c#L346
Aha, i see, so vmmcall CPU instruction is employed. Well, i believe this very
well fits into the sematics of KVM_EXIT_HYPERCALL,
because it's a true hypercall.
> The code simply decodes hypercall parameters from vcpu registers then
> handle hypercall code in switch and encode return code inside vcpu
> registers. Probably encode and decode of hypercall parameters/return
> code can be done in QEMU so we need only some exit with parameter that
> this is Hyper-V hypercall and probably KVM_EXIT_HYPERCALL is good for it.
Or you could even reuse the whole structure, it has all you need:
__u64 nr; /* Reserved for x86, other
architectures can use it, for example ARM "hvc #nr" */
__u64 args[6]; /* rax, rbx, rcx, rdx, rdi, rsi */
__u64 ret;
__u32 longmode; /* longmode; other architectures (like
ARM64) can also make sense of it */
Or you could put in struct kvm_regs instead of args and ret, and allow the
userspace to manipulate it.
> But KVM_EXIT_HYPERCALL is not used inside KVM/QEMU so requires
> implementation.
I guess your hypercalls to be introduced using KVM_EXIT_HYPERV are also not
used inside qemu so require implementation :)
Kind regards,
Pavel Fedin
Expert Engineer
Samsung Electronics Research center Russia
- Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit, Pavel Fedin, 2015/12/18
- Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit, Denis V. Lunev, 2015/12/18
- Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit, Paolo Bonzini, 2015/12/18
- Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit, Peter Hornyack, 2015/12/18
- Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit, Paolo Bonzini, 2015/12/18
- Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit, Roman Kagan, 2015/12/18
- Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit, Andrey Smetanin, 2015/12/21
- Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit, Pavel Fedin, 2015/12/21
- Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit, Andrey Smetanin, 2015/12/21
- Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit,
Pavel Fedin <=
Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit, 'Roman Kagan', 2015/12/18
Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit, Pavel Fedin, 2015/12/21
Re: [Qemu-devel] [PATCH v4 5/5] kvm/x86: Hyper-V kvm exit, 'Roman Kagan', 2015/12/18