From: Avi Kivity <avi@redhat.com>
To: Ed Swierk <eswierk@aristanetworks.com>
Cc: Gerd Hoffmann <kraxel@redhat.com>, Alexander Graf <agraf@suse.de>,
"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: Userspace MSR handling
Date: Wed, 27 May 2009 19:28:13 +0300 [thread overview]
Message-ID: <4A1D6A1D.2040400@redhat.com> (raw)
In-Reply-To: <9ae48b020905270912ib832446q28c47ebaf0da1720@mail.gmail.com>
Ed Swierk wrote:
> On Mon, May 25, 2009 at 4:20 AM, Avi Kivity <avi@redhat.com> wrote:
>
>> Device drivers have no business writing to cpu model specific registers. I
>> hate to bring that fugliness to kvm but I do want to support Xen guests.
>>
>> It should have been implemented as mmio. Maybe implement an ioctl that
>> converts rdmsr/wrmsr to equivalent mmios?
>>
>
> Converting MSRs to IO sounds fine, but a generic mechanism, with a new
> ioctl type and all the bookkeeping for a dynamically-sized list of
> MSR-to-MMIO mappings, seems like overkill given the puny scope of the
> problem. All the Xen HVM guest needs is a single, arbitrary MSR that
> when written generates an MMIO or PIO write handled by userspace. If
> this requirement is unique and we don't expect to find other guests
> that similarly abuse MSRs, could we get away with a less flexible but
> simpler mechanism?
>
I agree, it's stupid.
> What I have in mind is choosing an unused legacy IO port range, say,
> 0x28-0x2f, and implementing a KVM-specific MSR, say, MSR_KVM_IO_28,
> that maps rdmsr/wrmsr to a pair of inl/outl operations on these ports.
> Either MMIO or PIO would work, but I'm assuming it's safer to grab
> currently-unused IO ports than particular memory addresses.
>
It's just as bad.
> That odor you smell is the aroma of hardcoded goop, but I'm trying to
> find a solution that doesn't burden KVM with a big chunk of code to
> solve a one-off problem.
>
Will it actually solve the problem?
- can all hypercalls that can be issued with
pv-on-hvm-on-kvm-with-a-side-order-of-fries be satisfied from userspace?
- what about connecting the guest driver to xen netback one day? we
don't want to go through userspace for that.
We can consider catering to Xen and implementing that MSR in the kernel,
if it's truly one off.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2009-05-27 16:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-05-22 20:11 Userspace MSR handling Ed Swierk
2009-05-23 8:57 ` Alexander Graf
2009-05-24 12:07 ` Avi Kivity
2009-05-24 16:15 ` Alexander Graf
2009-05-26 11:31 ` Avi Kivity
2009-05-25 11:03 ` Gerd Hoffmann
2009-05-25 11:20 ` Avi Kivity
2009-05-25 11:29 ` Gerd Hoffmann
2009-05-25 11:31 ` Avi Kivity
2009-05-27 16:12 ` Ed Swierk
2009-05-27 16:28 ` Avi Kivity [this message]
2009-05-27 17:09 ` Ed Swierk
2009-05-27 19:16 ` Gerd Hoffmann
2009-05-27 23:00 ` Ed Swierk
2009-05-28 8:53 ` Avi Kivity
2009-05-29 9:47 ` Gerd Hoffmann
2009-05-31 8:21 ` Avi Kivity
2009-05-25 11:16 ` Gerd Hoffmann
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=4A1D6A1D.2040400@redhat.com \
--to=avi@redhat.com \
--cc=agraf@suse.de \
--cc=eswierk@aristanetworks.com \
--cc=kraxel@redhat.com \
--cc=kvm@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 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.