From: Avi Kivity <avi@qumranet.com>
To: Anthony Liguori <anthony@codemonkey.ws>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
kvm-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [kvm-devel] [PATCH] Refactor hypercall infrastructure
Date: Sat, 15 Sep 2007 10:53:16 +0300 [thread overview]
Message-ID: <46EB8F6C.3090008@qumranet.com> (raw)
In-Reply-To: <46EAF6FC.80207@codemonkey.ws>
Anthony Liguori wrote:
> Jeremy Fitzhardinge wrote:
>
>> Anthony Liguori wrote:
>>
>>
>>> This patch refactors the current hypercall infrastructure to better support live
>>> migration and SMP. It eliminates the hypercall page by trapping the UD
>>> exception that would occur if you used the wrong hypercall instruction for the
>>> underlying architecture and replacing it with the right one lazily.
>>>
>>>
>>>
>> I guess it would be pretty rude/unlikely for these opcodes to get reused
>> in other implementations... But couldn't you make the page trap
>> instead, rather than relying on an instruction fault?
>>
>>
>
> The whole point of using the instruction is to allow hypercalls to be
> used in many locations. This has the nice side effect of not requiring
> a central hypercall initialization routine in the guest to fetch the
> hypercall page. A PV driver can be completely independent of any other
> code provided that it restricts itself to it's hypercall namespace.
>
>
It also has the benefit of not requiring an initialization protocol, and
of reducing complaints about the hypervisor injecting code into the guest.
>>> It also introduces the infrastructure to probe for hypercall available via
>>> CPUID leaves 0x40000002. CPUID leaf 0x40000003 should be filled out by
>>> userspace.
>>>
>>>
>>>
>> Is this compatible with Xen's (and other's) use of cpuid? That is,
>> 0x40000000 returns a hypervisor-specific signature in e[bcd]x, and eax
>> has the max hypervisor leaf.
>>
>>
>
> Xen is currently using 0/1/2. I had thought it was only using 0/1. The
> intention was not to squash Xen's current CPUID usage so that it would
> still be possible for Xen to make use of the guest code. Can we agree
> that Xen won't squash leaves 3/4 or is it not worth trying to be
> compatible at this point?
>
I definitely want kvm to be able to emulate the Xen hypercall interface,
but there's no need to allow both concurrently. So I'd say use
0x40000000 for detection and the rest cannot clash because detection fails.
--
Do not meddle in the internals of kernels, for they are subtle and quick to panic.
next prev parent reply other threads:[~2007-09-15 7:53 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-14 19:45 [PATCH] Refactor hypercall infrastructure Anthony Liguori
2007-09-14 20:53 ` Jeremy Fitzhardinge
2007-09-14 21:02 ` [kvm-devel] " Anthony Liguori
2007-09-14 21:20 ` Zachary Amsden
2007-09-14 21:44 ` Anthony Liguori
2007-09-15 3:37 ` Zachary Amsden
2007-09-15 8:08 ` Avi Kivity
2007-09-15 17:33 ` Anthony Liguori
2007-09-14 21:22 ` Jeremy Fitzhardinge
2007-09-14 21:46 ` Anthony Liguori
2007-09-14 21:52 ` Jeremy Fitzhardinge
2007-09-14 22:08 ` Anthony Liguori
2007-09-14 22:40 ` Nakajima, Jun
2007-09-14 23:00 ` Jeremy Fitzhardinge
2007-09-15 0:10 ` Nakajima, Jun
2007-09-15 0:28 ` Jeremy Fitzhardinge
2007-09-15 1:04 ` Nakajima, Jun
2007-09-15 4:53 ` Jeremy Fitzhardinge
2007-09-15 6:11 ` Nakajima, Jun
2007-09-15 18:23 ` Anthony Liguori
2007-09-17 18:14 ` Nakajima, Jun
2007-09-17 18:27 ` Anthony Liguori
2007-09-17 19:15 ` Jeremy Fitzhardinge
2007-09-17 19:33 ` Anthony Liguori
2007-09-17 19:15 ` Jeremy Fitzhardinge
2007-09-17 20:52 ` Nakajima, Jun
2007-09-15 8:00 ` Avi Kivity
2007-09-15 7:53 ` Avi Kivity [this message]
2007-09-15 2:35 ` Rusty Russell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46EB8F6C.3090008@qumranet.com \
--to=avi@qumranet.com \
--cc=anthony@codemonkey.ws \
--cc=jeremy@goop.org \
--cc=kvm-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).