[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJSP0QWhkgot=42NVW7ra7MBJt1pDSo11mT+jcuiBLoeuaPHCA@mail.gmail.com>
Date: Fri, 13 Jan 2012 10:11:40 +0000
From: Stefan Hajnoczi <stefanha@...il.com>
To: Liu ping fan <kernelfans@...il.com>
Cc: kvm@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: Could anybody give some description about the implement of
hyercall in kvm?
On Fri, Jan 13, 2012 at 7:45 AM, Liu ping fan <kernelfans@...il.com> wrote:
> On Thu, Jan 12, 2012 at 5:21 PM, Stefan Hajnoczi <stefanha@...il.com> wrote:
>> On Thu, Jan 12, 2012 at 4:38 AM, Liu ping fan <kernelfans@...il.com> wrote:
>>> Could anybody give some description about the implement of hyercall in
>>> kvm? Or give some links about it?
>>
>> Try git grep hypercall arch/x86/kvm.
>>
>> Take a look at arch/x86/kvm/x86.c kvm_set_msr_common() and
>> kvm_emulate_hypercall(). Some of the KVM time-keeping, minimal HyperV
>> support, and async page faults live there. Also see
>> arch/x86/include/asm/kvm_para.h.
>>
>> Hypercalls are architecture-specific so if you are interested in ppc
>> or s390, check those arch directories.
>>
> Thanks, but when I tried to start from the macro "____PVOP_VCALL", but
> lost in it. If there is some document like the hypercall in Xen, this
> will be appreciated. (And I guest Hypercall in kvm is the same as Xen
> which is very similar to syscall, right?)
You can read about paravirt_ops to understand why that layer of
indirection is present:
http://lwn.net/Articles/194543/
But that macro is not the actual hypercall instructions, just a
mechanism for runtime-patching the kernel depending on whether it's
running on bare metal, KVM, Xen, etc.
What you really should look at if you're interested in specific
paravirt features that you are interested in. For example,
arch/x86/kernel/kvmclock.c implements a paravirt clock using
"paravirt" Model Specific Registers and a shared memory region as the
guest<->host interface. So I guess you could say KVM paravirt uses
several mechanisms for host<->guest interaction.
Stefan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists