All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gerd Hoffmann <kraxel@redhat.com>
To: Avi Kivity <avi@redhat.com>
Cc: Anthony Liguori <anthony@codemonkey.ws>,
	Huang Ying <ying.huang@intel.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Andi Kleen <andi@firstfloor.org>
Subject: Re: [PATCH] Add MCE support to KVM
Date: Mon, 20 Apr 2009 15:24:39 +0200	[thread overview]
Message-ID: <49EC7797.7060004@redhat.com> (raw)
In-Reply-To: <49EC6DEE.4070703@redhat.com>

On 04/20/09 14:43, Avi Kivity wrote:
> Gerd Hoffmann wrote:
>>> That said, I'd like to be able to emulate the Xen HVM hypercalls. But in
>>> any case, they hypercall implementation has to be in the kernel,
>>
>> No. With Xenner the xen hypercall emulation code lives in guest
>> address space.
>
> In this case the guest ring-0 code should trap the #GP, and install the
> hypercall page (which uses sysenter/syscall?). No kvm or qemu changes
> needed.

Doesn't fly.

Reason #1: In the pv-on-hvm case the guest runs on ring0.
Reason #2: Chicken-egg issue:  For the pv-on-hvm case only few,
            simple hypercalls are needed.  The code to handle them
            is small enougth that it can be loaded directly into the
            hypercall page(s).

pure-pv doesn't need it in the first place.  But, yes, there I could 
simply trap #GP because the guest kernel runs on ring #1 (or #3 on 64bit).

>>> Especially if we need to support
>>> tricky bits like continuations.
>>
>> Is there any reason to? I *think* xen does it for better scheduling
>> latency. But with xen emulation sitting in guest address space we can
>> schedule the guest at will anyway.
>
> It also improves latency within the guest itself. At least I think that
> what was the Hyper-V spec is saying. You can interrupt the execution of
> a long hypercall, inject and interrupt, and resume. Sort of like a
> rep/movs instruction, which the cpu can and will interrupt.

Hmm.  Needs investigation..  I'd expect the main source of latencies is 
page table walking.  Xen works very different from kvm+xenner here ...

> For Xenner, no (and you don't need to intercept the msr at all),  but for
> pv-on-hvm, you do need to update the code.

Xenner handling pv-on-hvm doesn't need code updates either.  Real Xen 
does as it uses vmcall, not sure how they handle migration.

cheers
   Gerd

  reply	other threads:[~2009-04-20 13:25 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-08  1:53 [PATCH] Add MCE support to KVM Huang Ying
2009-04-09 15:50 ` Avi Kivity
2009-04-10  3:00   ` Huang Ying
2009-04-11 12:04     ` Avi Kivity
2009-04-11 12:19       ` Andi Kleen
2009-04-11 12:25         ` Avi Kivity
2009-04-13  8:26           ` Andi Kleen
2009-04-13  2:41       ` Huang Ying
2009-04-13 13:02         ` Avi Kivity
2009-04-14  2:04           ` Huang Ying
2009-04-14 10:45             ` Avi Kivity
2009-04-15  7:24               ` Huang Ying
2009-04-18 22:17           ` Anthony Liguori
2009-04-19  8:33             ` Avi Kivity
2009-04-20  7:52               ` Gerd Hoffmann
2009-04-20  8:26                 ` Avi Kivity
2009-04-20  8:59                   ` Gerd Hoffmann
2009-04-20  9:05                     ` Avi Kivity
2009-04-20 10:04                       ` Andi Kleen
2009-04-20 11:02                         ` Avi Kivity
2009-04-20 11:23                       ` Gerd Hoffmann
2009-04-20 11:27                         ` Avi Kivity
2009-04-20 12:20                           ` Gerd Hoffmann
2009-04-20 12:43                             ` Avi Kivity
2009-04-20 13:24                               ` Gerd Hoffmann [this message]
2009-04-20 13:45                                 ` Avi Kivity
2009-04-21  9:14                                   ` Xenner design and kvm msr handling Gerd Hoffmann
2009-04-21 10:14                                     ` Avi Kivity
2009-04-21 11:41                                       ` Gerd Hoffmann
2009-04-21 12:27                                         ` Avi Kivity
2009-04-21 12:47                                           ` Gerd Hoffmann
2009-04-21 13:33                                             ` Avi Kivity
2009-04-21 16:00                                               ` Gerd Hoffmann
2009-04-21 16:15                                                 ` Avi Kivity
2009-04-21 16:15                                                   ` Avi Kivity
2009-04-22 10:02                                                   ` Gerd Hoffmann
2009-04-22 10:02                                                     ` Gerd Hoffmann
2009-04-21 16:04               ` [PATCH] Add MCE support to KVM Anthony Liguori
2009-04-21 16:17                 ` Avi Kivity

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=49EC7797.7060004@redhat.com \
    --to=kraxel@redhat.com \
    --cc=andi@firstfloor.org \
    --cc=anthony@codemonkey.ws \
    --cc=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ying.huang@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.